Python - run Excel macro

前端 未结 2 1601
说谎
说谎 2020-12-11 07:26

I would like to use Python to run a macro contained in MacroBook.xlsm on a worksheet in Data.csv.

Normally in excel, I have both files open and shift focus to the Da

2条回答
  •  执念已碎
    2020-12-11 08:19

    Try savin the macro to your "Normal" Project and call.

    excel.Application.Run("Normal.ModuleName.SubName")
    

    You can even add the Module to the Normal profile programmatically, but Office doesn't let you do it if you have insufficient access rights.

提交回复
热议问题