使用Workbook.caller()

时间:2015-04-27 02:07:45

标签: xlwings

我正在尝试使用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

寻求任何帮助。

1 个答案:

答案 0 :(得分:0)

这应该在昨天的0.3.5版本中修复,请参阅release notes。 像这样升级:pip install --upgrade xlwings