我正在尝试使用 xlwings 从 excel 调用 python 代码。工作簿的名称是“wingsTest”。如果我调用的代码中的第一行wb = Workbook("wingsTest")
运行良好,但是当wb = Workbook.caller()
我收到以下错误时:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\rbn\Documents\PythonScripts\apnlookupXL.py", line 74, in main
wb = Workbook.caller()
File "F:\Anaconda3\lib\site-packages\xlwings\main.py", line 182, in caller
xl_workbook = xlplatform.get_xl_workbook_from_xl(fullname)
File "F:\Anaconda3\lib\site-packages\xlwings\_xlwindows.py", line 429, in get_xl_workbook_from_xl
if not is_file_open(unicode(fullname)):
NameError: name 'unicode' is not defined
谢谢任何帮助。