Closed vmendl closed 3 years ago
I have the same problem. Even when xlsxio is used to open a file and save it with no changes, its then impossible to open it from Office, as it is shown "corrupted".
Which version of XLSX I/O did you use? Can you send the log file listing repairs?
I integrated the latest version to a Visual Studio 2017 project as a static lib. Where should I find such log file?
On Thu, Mar 11, 2021 at 11:59 AM Brecht Sanders @.***> wrote:
Which version of XLSX I/O did you use? Can you send the log file listing repairs?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brechtsanders/xlsxio/issues/91#issuecomment-796652311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYGDPKLNISZLNC7CP7MVEDTDCPCDANCNFSM4U32OXSA .
By clicking on the link below the error (see your own screenshot, just above the Close button)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error107920_01.xml</logFileName><summary>Errors were detected in file 'https://d.docs.live.net/ea373ad9f9c16144/Documents/Billboards Project/test.xlsx'</summary><additionalInfo><info>Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.</info></additionalInfo></recoveryLog>
I deleted the line and tried again. The code now is:
const char* docprops_app_xml =
XML_HEADER
"<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">" OPTIONAL_LINE_BREAK
"<Application>" XLSXIOWRITE_NAME "</Application>" OPTIONAL_LINE_BREAK
"</Properties>" OPTIONAL_LINE_BREAK;
Got the following log:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error141080_01.xml</logFileName><summary>Errors were detected in file 'https://d.docs.live.net/ea373ad9f9c16144/Documents/Billboards Project/newtest.xlsx'</summary><additionalInfo><info>Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.</info></additionalInfo></recoveryLog>
I will also upload a sample file that was saved with xlsxio_write.c. newtest.xlsx
Fixed in xlsxio_write.c
Checked the updated version but still get:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error123880_01.xml</logFileName><summary>Errors were detected in file 'https://d.docs.live.net/ea373ad9f9c16144/Documents/Billboards Project/test.xlsx'</summary><additionalInfo><info>Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.</info></additionalInfo></recoveryLog>
Test file attached. test2.xlsx
It is not possible to open xlsx files by Microsoft Excel Viewer or Office professional plus 2016. Solution is to remove tag
<AppVersion>xxxx</AppVersion>
from app.xml. Tag<AppVersion>
must be valid Microsoft Excel version. Tag<Application>
is not checked by Microsoft Excel. Include version in tag<Application>
as in Libre office and remove tag<AppVersion>.
Best regards Vladimir