Reputation: 1
In my excel file I hide certain column(s) and when I read the column visible state with openpyxl, following situations happen:
It seems that only the first column can be read out hidden for a consecutive column set hidden. My source code is as below. If anything wrong, please let me know. Thanks.
import openpyxl
work_book = openpyxl.load_workbook('test_1.xlsx', read_only=False)
work_sheet = work_book.get_sheet_by_name('sheet_1')
for col in ['A', 'B', 'C', 'D', 'E', 'F', 'G']:
print work_sheet.column_dimensions[col].hidden
Upvotes: 0
Views: 956
Reputation: 19527
Excel merges the definitions of the columns A:C together. You can check for this looking at the min
and max
attributes of the relevant column definition.
Upvotes: 2