[GH-ISSUE #268] Error opening file with Excel #211

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

Originally created by @duncangroenewald on GitHub (Jan 17, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/268

Originally assigned to: @jmcnamara on GitHub.

I am getting an error on one generated file when opening with Excel. See the following error log output. I can upload a copy of the generated file is required. The file seems to open fine but it's a bit annoying getting this message.

Repair Result to XXXX Extract 2020-01-17_2307480.xml

Errors were detected in file ’/Users/Shared/XXXX/Reports/Stock/XXXX Extract 2020-01-17_230748.xlsx’Repaired Records: Cell information from /xl/worksheets/sheet1.xml part

Originally created by @duncangroenewald on GitHub (Jan 17, 2020). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/268 Originally assigned to: @jmcnamara on GitHub. I am getting an error on one generated file when opening with Excel. See the following error log output. I can upload a copy of the generated file is required. The file seems to open fine but it's a bit annoying getting this message. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>Repair Result to XXXX Extract 2020-01-17_2307480.xml</logFileName><summary>Errors were detected in file ’/Users/Shared/XXXX/Reports/Stock/XXXX Extract 2020-01-17_230748.xlsx’</summary><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</repairedRecord></repairedRecords></recoveryLog>
gitea-mirror 2026-05-05 11:56:17 -06:00
Author
Owner

@jmcnamara commented on GitHub (Jan 17, 2020):

I can upload a copy of the generated file is required.

Yes, if you can. If it contains confidential information you can email it to me instead.

A small program that reproduces the issue would be better. Or if you can debug it then strip your program down until the error goes away.

It isn't a very common issue but things that can cause it are:

  • Non-UTF8 data in the strings
  • Overlapping merged ranges.
<!-- gh-comment-id:575615634 --> @jmcnamara commented on GitHub (Jan 17, 2020): > I can upload a copy of the generated file is required. Yes, if you can. If it contains confidential information you can email it to me instead. A small program that reproduces the issue would be better. Or if you can debug it then strip your program down until the error goes away. It isn't a very common issue but things that can cause it are: - Non-UTF8 data in the strings - Overlapping merged ranges.
Author
Owner

@duncangroenewald commented on GitHub (Jan 18, 2020):

Thanks, it was being caused by Swift Double values that were NaN. I would think it should handle that - i.e. convert to something Excel understands. As it is I fixed it by adding a check for Nan and don't write out the value.

<!-- gh-comment-id:575859021 --> @duncangroenewald commented on GitHub (Jan 18, 2020): Thanks, it was being caused by Swift Double values that were NaN. I would think it should handle that - i.e. convert to something Excel understands. As it is I fixed it by adding a check for Nan and don't write out the value.
Author
Owner

@jmcnamara commented on GitHub (Jan 18, 2020):

I would think it should handle that - i.e. convert to something Excel understands.

It is hard to detect NaN portably in C. Also Excel doesn't have a representation for NaN (outside of a formula result).

As it is I fixed it by adding a check for Nan and don't write out the value.

I think that is the best approach for now.

<!-- gh-comment-id:575884411 --> @jmcnamara commented on GitHub (Jan 18, 2020): > I would think it should handle that - i.e. convert to something Excel understands. It is hard to detect NaN portably in C. Also Excel doesn't have a representation for NaN (outside of a formula result). > As it is I fixed it by adding a check for Nan and don't write out the value. I think that is the best approach for now.
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#211
No description provided.