添加定义名称失败

失败结果:

['A', None]]
[['A', None]]
Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/TB_SPIDER/spider_excel/excel_defind_names.py", line 92, in <module>
    f(xl_savefile, name, orginal_name, new_name)
  File "C:/Users/Administrator/Desktop/TB_SPIDER/spider_excel/excel_defind_names.py", line 63, in f
    wb.defined_names.append(dname)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\openpyxl\workbook\defined_name.py", line 201, in append
    raise ValueError("""DefinedName with the same name and scope already exists""")

ValueError: DefinedName with the same name and scope already exists

 

原因:

所有表中 所有字段 必须 唯一,不能重复

posted @ 2018-06-14 16:15  殇夜00  阅读(17)  评论(0)    收藏  举报