tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.49k stars 418 forks source link

Corrupted excel after loading #478

Closed 945fc41467 closed 4 years ago

945fc41467 commented 4 years ago

Hello, My issue is similar to the #365, #476, #343 and #349.

If I create a new file, my code run well. But if I try to load a preformated xlsx and just add values in cells, when I reopen the file, I have the following message : « Sorry, but we found a problem in the content of “myexcel.xlsx”, but we can try to recover the maximum of content. If the source of the workbook is reliable, click yes. » And when I click ok : « Excel terminated validation and reparation of new file. Some part of the workbook could have been repaired or abandonned. Data deleted: display in the part /xl/workbook.xml (Workbook) » This is an approximative translation, I don’t know what is the exact message on English version. And when it open, the display parameters are completely random, with different font, alignment, weight, etc.

Unfortunately I can not share the files I am working with. What I can say :

Thanks for your help.

tfussell commented 4 years ago

Thanks for contributing. Generally this means that the XML is missing some data or has unexpected data. I would guess that the images/text zones are causing this issue as they are not currently supported in the library. My recommendation would be to use a "binary search" by reading and writing files with various features until you find the single feature that is causing this problem and give me a reproduction case so I can fix it. We can reopen this issue if you can do that and it's not an unsupported feature like images.

945fc41467 commented 4 years ago

Hi, and thank for your answer. I try deleting all the images, data, formatting, without result. I tried to create a New workbook on my desktop, rename it an copy all data, images, and formatting and it worked fine. So it seem it is a deeper feature as versioning, metadata or something else.

So as it is not the content itself, I think it is ok if I send you an emptied file to take a look.

github file.xlsx