0
我嘗試使用Parallels中的Microsoft Excel打開我的mac上的斐波那契模板,但出現以下錯誤(xlwings版本0.4.1)。 該文件使用Microsoft Excel自動打開並出現錯誤。在mac上使用xlWings時出現錯誤
有人有任何想法如何糾正?
In[39]: wb = Workbook(r'/Users/Downloads/fibonacci.zip Folder/fibonacci.xlsm')
Traceback (most recent call last):
File "/Users/anaconda/lib/python2.7/site- packages/IPython/core/interactiveshell.py", line 3035, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-39-8750713fa323>", line 1, in <module>
wb = Workbook(r'/Users/Downloads/fibonacci.zip Folder/fibonacci.xlsm')
File "/Users/anaconda/lib/python2.7/site-packages/xlwings/main.py", line 158, in __init__
self.name = xlplatform.get_workbook_name(self.xl_workbook)
File "/Users/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 102, in get_workbook_name
return xl_workbook.name.get()
File "/Users/anaconda/lib/python2.7/site-packages/aeosa/appscript/reference.py", line 498, in __call__
raise CommandError(self, (args, kargs), e, self.AS_appdata)
CommandError: Command failed:
OSERROR: -1708
MESSAGE: Application could not handle this command.
COMMAND: app(u'/Users/Applications (Parallels)/{716d2333-63ae-4f42-a203-ae81a0a171db} Applications.localized/Microsoft Excel.app').workbooks['fibonacci.xlsm'].name.get()
感謝您的回覆。我知道我們不能使用Windows Excel通過類似方法從安裝在MacOSX上的python調用xlwings?像使用這樣的命令:wb = Workbook(r'/ Users/Downloads/fibonacci.zip Folder/fibonacci.xlsm',app_target = r'/ Users/Applications(Parallels)/ {716d2333-63ae-4f42-a203-ae81a0a171db } Applications.localized/Microsoft Excel.app') –
是的,你理解正確,這是一個自然的限制。例如。您還很難通過Mac Python安裝訪問Parellels-Windows上的文件... –