I need to update an xlsm file using python from a DataFrame. How can I modify that file without errors? My principal problem is this: I overwrite the file and save it, and I when go to open it, the file is corrupt and I can't open it.
def write_data(self, sheet, col_start, row_start):
with ExcelWriter('TEST.xlsm') as writer:
self.get_data2post(sheet).to_excel(writer,
startcol = col_start,
startrow = row_start,
sheet_name = sheet,
header = False,
index = False)
writer.save()
writer.close()