Hi @Matt Binsfeld ,
In the styles.xml part from the file you sent there are 2 <xf />
elements with invalid values for the xfId
attribute. In ISO-29500 18.8.45 xf (Format) the xfId attribute is defined:
“For xf records contained in cellXfs this is the zero-based index of an xf record contained in cellStyleXfs corresponding to the cell style applied to the cell.”
If you look at the xf elements with xpaths
• /x:styleSheet1/x:cellXfs1/x:xf[151]
• /x:styleSheet1/x:cellXfs1/x:xf[149]
You can see that they have indexes of 84 and 85, but if you look at the <cellStyleXfs /> element, it only contains 6 elements, so 84 and 85 are invalid indexes.
Both full errors are:
Id Sem_MissingIndexedElement
Description Element 'DocumentFormat.OpenXml.Spreadsheet.CellFormat' referenced by 'xf@xfId' does not exist in part '/xl/styles.xml'. The index is '84'.
XPath /x:styleSheet1/x:cellXfs1/x:xf[151]
Part URI /xl/styles.xml
NamespacesDefinitions xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
Id Sem_MissingIndexedElement
Description Element 'DocumentFormat.OpenXml.Spreadsheet.CellFormat' referenced by 'xf@xfId' does not exist in part '/xl/styles.xml'. The index is '85'.
XPath /x:styleSheet1/x:cellXfs1/x:xf[149]
Part URI /xl/styles.xml
NamespacesDefinitions xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
To find these errors I used an extension for VS Code the OOXML Validator, which validates OOXML files and log the errors.
I edited the xfId attributes to be valid indexes with this VS Code extension (OOXML Viewer), this fixed the validation error, but there is still an issue with the file. I think it may be because I just picked valid, but random indexes to test with and not what the xfId values should be.
Can you get your software to replace the invalid indexes and see if this fixes the issue?
Thanks,
Michael Bowen
Escalation Engineer - Microsoft Open Specifications