What causes “UserWarning: Discarded range with reserved name” - openpyxl

后端 未结 3 1679
[愿得一人]
[愿得一人] 2021-02-12 23:26

I have a simple EXCEL-sheet with names of cities in column A and I want to extract them and put them in a list:

def getCityfromEXCEL():
    wb = load_workbook(fi         


        
3条回答
  •  滥情空心
    2021-02-12 23:30

    It's supposed to be a friendly warning letting you know that some of the defined names are being lost when reading the file. Warnings in Python are not exceptions but informational notices.

    Support for defined names is essentially limited to references to cell ranges in openpyxl at the moment. But they can refer to lots of other things like printing settings. However, if the objects/values they refer to are not preserved by openpyxl and the file is saved and later opened by Excel it might complain about the missing objects.

提交回复
热议问题