[GH-ISSUE #117] Open error of file under Windows Excel 2016 #97

Closed
opened 2026-05-05 11:40:06 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @petricf on GitHub (Aug 11, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/117

Originally assigned to: @jmcnamara on GitHub.

Generating an xlsx-file under Linux (libxlsxwriter version 0.7.2). The code:

  lxw_workbook * workbook = workbook_new ("/home/petric/test-excel.xlsx");
  lxw_worksheet * worksheet = workbook_add_worksheet (workbook, "Test");

  lxw_format * format = workbook_add_format (workbook);
  format_set_text_wrap (format);

  worksheet_write_string (worksheet, 0, 0, "Hello Me!\nSecond line", format);

  workbook_close (workbook);

The resulting file:
test-excel.xlsx

When opening this file with Excel 2016 (Windows 7) i get the following errors:
error1

Selecting "Yes":
error2

The second error refers an xml file with this contents:

<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error050120_01.xml</logFileName>
<summary>Errors were detected in file 'D:\test-excel.xlsx'</summary>
<repairedParts>
<repairedPart>
Repaired Part: /xl/worksheets/sheet1.xml part with XML error. Load error. Line 2, column 460.
</repairedPart>
</repairedParts>
</recoveryLog>

The repair seems to fix this. Saving it back to the file i get:
test-excel-fixed.xlsx

Maybe a comparison of the two excel files helps to track down the problem.

Originally created by @petricf on GitHub (Aug 11, 2017). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/117 Originally assigned to: @jmcnamara on GitHub. Generating an xlsx-file under Linux (libxlsxwriter version 0.7.2). The code: ``` lxw_workbook * workbook = workbook_new ("/home/petric/test-excel.xlsx"); lxw_worksheet * worksheet = workbook_add_worksheet (workbook, "Test"); lxw_format * format = workbook_add_format (workbook); format_set_text_wrap (format); worksheet_write_string (worksheet, 0, 0, "Hello Me!\nSecond line", format); workbook_close (workbook); ``` The resulting file: [test-excel.xlsx](https://github.com/jmcnamara/libxlsxwriter/files/1217460/test-excel.xlsx) When opening this file with Excel 2016 (Windows 7) i get the following errors: ![error1](https://user-images.githubusercontent.com/30858197/29208358-03c443e4-7e8a-11e7-85c2-c2f4db8a8c6a.PNG) Selecting "Yes": ![error2](https://user-images.githubusercontent.com/30858197/29208363-08964c1e-7e8a-11e7-9f8b-5b5abe19f88e.PNG) The second error refers an xml file with this contents: ``` <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <logFileName>error050120_01.xml</logFileName> <summary>Errors were detected in file 'D:\test-excel.xlsx'</summary> <repairedParts> <repairedPart> Repaired Part: /xl/worksheets/sheet1.xml part with XML error. Load error. Line 2, column 460. </repairedPart> </repairedParts> </recoveryLog> ``` The repair seems to fix this. Saving it back to the file i get: [test-excel-fixed.xlsx](https://github.com/jmcnamara/libxlsxwriter/files/1217476/test-excel-fixed.xlsx) Maybe a comparison of the two excel files helps to track down the problem.
Author
Owner

@utelle commented on GitHub (Aug 11, 2017):

Which locale is active while your application is generating the Excel file? Obviously not the C locale, since I inspected your test file and found out that the decimal separator used for writing double values is a comma. This doesn't work - as you experienced. The decimal separator has to be a point.

<!-- gh-comment-id:321774996 --> @utelle commented on GitHub (Aug 11, 2017): Which locale is active while your application is generating the Excel file? Obviously not the C locale, since I inspected your test file and found out that the decimal separator used for writing `double` values is a comma. This doesn't work - as you experienced. The decimal separator has to be a point.
Author
Owner

@jmcnamara commented on GitHub (Aug 11, 2017):

@petricf I had a look at the file and @utelle is correct. There is a comma instead of a point due to the locale.

See #64 for a long discussion.

I'm going to close this as a duplicate of #64.

<!-- gh-comment-id:321780214 --> @jmcnamara commented on GitHub (Aug 11, 2017): @petricf I had a look at the file and @utelle is correct. There is a comma instead of a point due to the locale. See #64 for a long discussion. I'm going to close this as a duplicate of #64.
Author
Owner

@petricf commented on GitHub (Aug 11, 2017):

Am Freitag 11 August 2017, 10:35:04 schrieb John McNamara:

@petricf I had a look at the file and @utelle is correct. There is a
comma
instead of a point due to the local.

See #64 for a long discussion.

I'm going to close this as a duplicate of #64.

Thanks. I'll subsrcibe to #64.

Hopefully this will fixed soon.

<!-- gh-comment-id:321784637 --> @petricf commented on GitHub (Aug 11, 2017): Am Freitag 11 August 2017, 10:35:04 schrieb John McNamara: > @petricf I had a look at the file and @utelle is correct. There is a comma > instead of a point due to the local. > > See #64 for a long discussion. > > I'm going to close this as a duplicate of #64. Thanks. I'll subsrcibe to #64. Hopefully this will fixed soon.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#97
No description provided.