-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File corruption after re-saving #1323
Comments
Thanks for your issue. There is only one comment allowed in a cell in the spreadsheet, so if you add the comment on the second run, the file will be corrupt. I've just merged pull request #1317, which introduced the new function |
Thanks a lot. The release is very timely) |
I suggest that the developer make sure to use the style ID which gets from the NewStyle or GetCellStyle function, and I will consider adding a checking for the style ID. |
I have added checking for the style ID, an error will be returned when setting the not existing style ID. Please upgrade to the master branch code, and this feature will be released in the next version. |
Hi👋.
Description
I have a small program that adds a comment to the file every run. On the second run, the file is corrupted. The bug works for the Save and AsSave functions. The comments may be different, but the problem is to re-add the comment to the same cell.
In addition, I noticed that adding a non-existing styleID to SetCellStyle func leads to file corruption.
Program
Result
After opening the re-saved file an error occurs that the file is corrupted
Excelize version or commit ID
I used the version of the last commit on the master branch:
commit d1e76fc
import:
github.com/xuri/excelize/v2 v2.6.1-0.20220817025952-d1e76fc432ac
Excel file
https://www.dropbox.com/scl/fi/lvqws5itronua15tpridk/test.xlsx?dl=0&rlkey=b2053854zq6qwdnt1p8d5v3qb
The text was updated successfully, but these errors were encountered: