Say I have loaded Report WW26blueprint_with_chart_330.xlsm
in the report
object with the following code (the print.range
is used here to test that the workbook is loaded):
import xl
report = xl.Workbook("Report WW26blueprint_with_chart_330.xlsm")
print report
print(report.range("A1:E50").get())
From the pyvot documentation I get that:
Pyvot is written on top of Excel’s COM API. You can always get the underlying COM object and make COM calls yourself
My Excel file has the following macros:
Macro1
Масго2
Macro7
Can I run any of the above macros directly from the python script using python/pyvot?
Didn't manage to do it with
pyvot
but can be done usingpywin32
as following:This did it for me: