Generated XLSX is invalid
See original GitHub issueI use ClosedXML version 0.85.0.0. I have Excel 2016 document which seems to be valid. It can be opened and saved smoothly in Excel 2016. It contains no data. I use ClosedXML to open and save it but generated file is invalid. Excel reports that it has invalid structure and needs to be fixed. Here is the code to open and save:
XLWorkbook workbook = new ClosedXML.Excel.XLWorkbook("aa.xlsx");
workbook.SaveAs("bb.xlsx");
The file bb.xlsx produced in ClosedXML version 0.80.0.0 was correct, while after upgrading to 0.85.0.0 it is incorrect.
Please find attached source Excel document:
aa.xlsx
file aa.xlsx.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Diagnosing Invalid XLSX - Microsoft Q&A
Hi, Our software generated an xlsx. Trying to open it in excel results in an error and Excel offers to repair the file,...
Read more >[Fixed] Excel Cannot Open the File Because the Extension ...
Summary: This post discusses workarounds to resolve the 'Excel cannot open the file because the extension is not valid' error.
Read more >Excel Cannot Open the File Because the Extension Is Not ...
Many times, this error occurs due to the incompatible file extension of the Excel file. MS Excel saves Excel workbooks as XLSX or...
Read more >XLSX file via OpenXml SDK Both Valid and Invalid
I have a program which exports a System.Data.DataTable to an XLSX / OpenXml Spreadsheet. Finally have it mostly working. However when opening ...
Read more >Excel produces invalid xls file when converting xlsx ...
Hello,. I am using Aspose.Cells to create Excel files (in xlsx format) from XML Spreadsheet format but users have discovered that when opening...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is for people who find this in a search who are calling SaveAs to a MemoryStream and then using GetBuffer to get an array of bytes. Use ToArray on the stream instead of GetBuffer.
I have tested 0.86. It works correct! Thanks.
Regards, Alt-WN