Python xlrd Named Range for Table Names

737 views Asked by At

I have defined a table (dynamic) with a name and tried to use the name range for this table (it is a table name instead of a name for a cell or for an area) in which VBA could easily fulfill. But I can not get the similar function from xlrd. After checking the xlrd document, I am confusing, "A name is used to refer to a cell, a group of cells, a constant value, a formula, or a macro." Does xlrd has the function to extract the name from a dynamic table or I should resort to another module which could deal with a dynamic table in regards of table name? Thank you!

01112017 Update: Which module should I resort to for Excel Table name?

01102017 Update:

book = xlrd.open_workbook('Table_Test.xls')
Name_Cell = book.name_map['test_cell'][0]
Name_Table = book.name_map['test_table'][0]

Name for Cell and Table

Traceback (most recent call last):
  File "C:\Python34\Debug\NameRange\RegionalStiff_Deck_Body_NameRange.py", line 13, in <module>
    Name_Table = book.name_map['test_table'][0]
KeyError: 'test_table'
1

There are 1 answers

0
John Machin On

xlrd does not cater for tables. You should be looking elsewhere.