I have a xlsx file with some format.
I want edit values, but keeping the format.
in ver 2.5.9
wb = load_workbook(filename=file) ws = wb['KOL'] ws.cell(row=1, column=1).value = 'new value' wb.save('new_test.xlsx') wb.close()
result (1st open)
While the new_text.xlsx open, the excel(ver.2019) shows "try to fix it".
After fix it, I can open the file, but the dataBar has changed.
- Color changed.
- The bar length changed.
Save it to 'new_text2.xlsx', and try to open it again.
result (2nd open)
The excel also shows "try to fix it", but the length of bar is correct.
I save it again, and reopen it, the excel will also ask "try to fix", forever.
I've test it again, I found there is 2 different problem.
The color of DataBar is a single one.
And the other one about "try to fix" is cause by "table".
I tried "trans the table to normal area"(I don't know how it shows in English, I use Chinese Version.) If the sheet has no table, no sort, the problem is solved, no more "fix it".