ReadFromFile() fails when reading an xlsx file created by ClosedXML
library
lazarus / 49-FPSpreadsheet
----------------------------------------------------------------------
volodimir_bond · 2018-11-09 21:24
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
----------------------------------------------------------------------
wp · 2018-11-09 21:49
Please post the file which causes the issue (rename its extension to
.zip, otherwise the forum software won't accept it).
----------------------------------------------------------------------
volodimir_bond · 2018-11-12 20:17
Hi,
Here is a short file that causes the issue - I changed the extension
from xlsx to zip
Thanks,
Volodimir
----------------------------------------------------------------------
wp · 2018-11-12 22:51
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:
Code: XML [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i
But your file uses here a namespace "x":
Code: XML [Select][+][-]window.onload = function(){var x1 =
document.getElementById("main_content_section"); if (x1) { var x =
document.getElementsByClassName("geshi");for (var i = 0; i
And it is not only the sheets node - almost all nodes are in namespace
x, and this means changes at numerous places --> Fixed in r6726.