Programming => Packages and Libraries => FPSpreadsheet => Topic started by: volodimir_bond on November 09, 2018, 10:24:14 pm
Title: ReadFromFile() fails when reading an xlsx file created by ClosedXML library
Post by: volodimir_bond on November 09, 2018, 10:24:14 pm
Hi, please help
ReadFromFile() fails reading a file created by "https://github.com/ClosedXML/ClosedXML" library
it is failing inside of TsSpreadOOXMLReader.ReadSheetList(ANode: TDOMNode) function because ANode is nil.
When open the file in Excel and simply save it back, it becomes larger and with a bit different structure inside. And I am able to open it with ReadFromFile().
Thanks, Vlad
Title: Re: ReadFromFile() fails when reading an xlsx file created by ClosedXML library
Post by: wp on November 09, 2018, 10:49:31 pm
Please post the file which causes the issue (rename its extension to .zip, otherwise the forum software won't accept it).
Title: Re: ReadFromFile() fails when reading an xlsx file created by ClosedXML library
Post by: volodimir_bond on November 12, 2018, 09:17:07 pm
Hi,
Here is a short file that causes the issue - I changed the extension from xlsx to zip
Thanks, Volodimir
Title: Re: ReadFromFile() fails when reading an xlsx file created by ClosedXML library
Post by: wp on November 12, 2018, 11:51:33 pm
Thank you for posting the file.
The problem is that OpenXML seems to write xlsx files in a different way than Excel does. The worksheet list - which causes the crash - is written by Excel (and fpspreadsheet) like this: