1

I have created a basic workbook with one worksheet and in this worksheet I have created a table (Insert>Table). Nothing complex in this table, just the value 1, 2, 3 (and the column header of course).

I have written this simply code

import openpyxl

thefilename = r"C:\Users\Myfile.xlsx"
book = openpyxl.load_workbook(thefilename)

book.activesheet

book.save(thefilename)

Then, when I try to open the excel file, the file is corrupted and impossible to reopen it again.

This looks like a bug but I wonder how I can detect if my excel file has a table and how to remove it ?

0 Answers0