Crash on Invalid Color Index #1412
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#1412
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I believe a similar problem to https://github.com/ClosedXML/ClosedXML/issues/307 happens here. I have XLSX file that SheetJS is not able to parse (the file is can be downloaded here).
It fails with
Uncaught Error: <color indexed="206"/>
.206 is not a valid indexed color according to
MS-XLS 2.5.161
:Inspecting the sheet, that particular style is used in exactly one cell! It is referenced in font ID 20:
Which is only referenced in style ID 56:
and that particular style is only used in the 9th sheet xml:
What's interesting is that Excel refuses to show the "Format Cells" popup when you right click on the cell B33 in the "incubation" worksheet! So it seems that this in fact a broken file that excel just opens. If you type text, it shows up as red:
Unfortunately VBA is of no help, manually setting the color index with something like
Range("A1").Font.ColorIndex = 206
results in run-time error 9: "Subscript out of range".Do you know how this file was generated? The file properties suggest Excel 2016 for Mac. Did it come from Excel? If so do you know what the build was? (it might have worked in a specific point release, and we can use that to figure out the original intention)
Thanks for fast and thorough analysis!
To be honest, I have no idea how this file was generated as I am just helping out a friend to build a viewer for their project. I will try to get the information you ask for.
I solved it by manually removing the color index from the styles of the file, so it is nothing urgent from my side, just wanted to let you know about the problem.