Tag: 解决

尝试通过com / pywin32从Python运行Excel-Solver时出错

我试图通过python32在python中运行Excels Solver加载项: import win32com.client from win32com.client import constants as c app = Dispatch("Excel.Application") app.Visible = True app.Workbooks.Open(r'C:\path\to\testsolver.xlsm') app.Run("runsolver") ..但得到以下错误: "Cannot run the macro 'runsolver'. The macro may not be available in this workbook or all macros may be disabled"