我使用“ xlwings quickstart myproject”创建了一个xlwings项目。之后,我单击了Excel中xlwings选项卡上的“导入功能”按钮。然后显示以下错误:
xlwings server running, clsid={5543C317-5922-460B-B181-75973283ED17}
pythoncom error: Python error invoking COM method.
Traceback (most recent call last):
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\win32com\server\policy.py", line 277, in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\win32com\server\policy.py", line 282, in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_
return func(*args)
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\xlwings\server.py", line 194, in Call
return ToVariant(getattr(obj, method)(*pargs, **kwargs))
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\xlwings\udfs.py", line 465, in import_udfs
xl_workbook.VBProject.VBComponents.Import(tf.name)
File "C:\Users\danielhaitao\Anaconda3\envs\Python2\lib\site-packages\win32com\client\dynamic.py", line 516, in __getattr__
ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1)
com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'Microsoft Excel', u'\u4e0d\u4fe1\u4efb\u5230 Visual Basic Project \u7684\u7a0b\u5e8f\u8fde\u63a5\n', u'xlmain11.chm', 0, -2146827284), None)