How do I call an Excel macro from Python using xlwings?

前端 未结 5 788
孤独总比滥情好
孤独总比滥情好 2020-11-27 20:11

I\'ve read the API docs for xlwings, and played around with Workbook and Sheet objects in the interpreter, but I can\'t figure out how to call a macro from Python.

H

5条回答
  •  时光取名叫无心
    2020-11-27 20:19

    Extending @Felix Zumstein's answer and all other answers here, please ensure you have disabled Macro settings as you may face COM issues later.

    You can change that under,

    File > Options > Trust Center > Trust Center Settings > Macro Settings > Enable all macros (not recommended...)

提交回复
热议问题