Ariel Ariel - 1 year ago 155
Python Question

Python vba extract to get bin of macro

I am trying to add a vba_project to "Sheet1" of a workbook using python.

I am following XLSXWRITER documentation to get the bin of the VBA code from a different sheet which I would want to use in "Sheet1" of my new workbook.

I enter the below code in command prompt but I get the error: "'' is not recognized as an internal or external command"

$ Book1.xlsm
Extracted: vbaProject.bin

Can someone give me a step by step on how to extract the macro from old file as bin and then input into sheet1 of new workbook using python?

Answer Source

You have to tell the cmd you're running a python file.

Try this batch code:

cd C:\path\of\
python Book1.xlsm

edit: Added cd command, you have to be in the folder of the python file.