The title said it all :)
But still, I'm using the class Table
from openpyxl.worksheet.table
to define a table in excel file which I create. My problem is that the table that is created has Filter
on the first row that I want to remove (from the script, not by opening the Excel file).
This is the calling for Table class:
tab = Table(displayName='Table_{}'.format(table_name.replace(' ', '_')),
ref="{}:{}".format(table_start, table_end))
This is what I get:
This is what I want to get:
I search for it at OpenPyXL Docs but find only adding that filtering...
There is any way to remove this?
Many thanks!
wb = load_workbook(filename="data.xlsx")
ws = wb["Sheet1"]
ws.auto_filter.ref = None
for i in range(2, ws.max_row + 1):
ws.row_dimensions[i].hidden = False
wb.save("data.xlsx")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With