1
我試圖運行擅長求解加載通過pywin32在python搭配:錯誤當試圖在COM/pywin32運行Excel的求解器從Python的
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"
我不記得解算器是否默認安裝在Excel中。你可能需要進入選項並以某種方式告訴它你想要求解器。 – minopret 2013-03-18 01:46:57
我的解算器加載項實際上已激活,並且它工作正常,如果我手動啓動它 – user990330 2013-03-18 01:59:51
COM/ActiveX安全性? – 2013-03-19 02:41:00