Vote count:
0
I am using Excel 2013, Python 3.4.1 (Anaconda 64-bit) and xlrd 0.9.3.
I made a workbook with the value 34 in cell B2, and gave B2 the name TestName. Then I saved the workbook as a 2013-version (test13.xlsx) and a 97-03 version (test03.xls) file.
I can only get the xlrd.Name object to work as expected with the 97-03 version file.
For example:
import xlrd
rb_03 = xlrd.open_workbook("test03.xls")
rb_13 = xlrd.open_workbook("test13.xlsx")
nm_03 = rb_03.name_map.get("TestName".lower())[0]
nm_13 = rb_13.name_map.get("TestName".lower())[0]
print("nm_03.result:", nm_03.result) # prints: nm_03.result: Operand(kind=oREF, value=[Ref3D(coords=(0, 1, 1, 2, 1, 2))], text='Sheet1!$B$2')
print("nm_13.result:", nm_13.result) # prints: None
print(nm_03.cell()) # prints: number:34.0
print(nm_13.cell()) # fails in line 253 of xlrd/book.py with: AttributeError: 'NoneType' object has no attribute 'logfile'
Is this a bug? If not, how can I read the value of the cell named TestName in test13.xlsx?
asked 1 min ago
xlrd named range not working for Excel 2013 workbooks?
Aucun commentaire:
Enregistrer un commentaire