我只是在 Mac 上修改 xlwings 以将值写入单元格。但是,当我初始化一个新工作簿时,我得到了这个:
import xlwings as xl
wb = xl.Workbook()
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/Developer/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Developer/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 30, in clean_up
app('Microsoft Excel').run_VB_macro('CleanUp')
File "/Developer/anaconda/lib/python2.7/site-packages/aeosa/appscript/reference.py", line 579, in __getattr__
raise AttributeError("Unknown property, element or command: %r" % name)
AttributeError: Unknown property, element or command: 'run_VB_macro'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/Developer/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Developer/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 30, in clean_up
app('Microsoft Excel').run_VB_macro('CleanUp')
File "/Developer/anaconda/lib/python2.7/site-packages/aeosa/appscript/reference.py", line 579, in __getattr__
raise AttributeError("Unknown property, element or command: %r" % name)
AttributeError: Unknown property, element or command: 'run_VB_macro'
Excel 确实打开并创建了一个新文件,但随后发生了异常。我不明白为什么它会在 Mac 上运行时尝试运行宏。我知道作者在这里。希望他能参与进来。