Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Unassigned: Workbook will not load with exception message of 'yellow [13] cannot be converted to Int32' (or something like that). [9363]

$
0
0
While reading in a workbook the following exception message occurred (or something similar to it).
yellow [13] can not be converted to Int32.

Traced this down to:
private void LoadColorsAndLines<T>(IXLDrawing<T> drawing, XElement shape)
line 442 the fillColor in this case is yellow [13].
then when XLColor.FromHtml(fillColor.Value) is executed the exception is thrown.

Guessing that in this case there is yet another list of colors that yellow [13] refers to rather than just the color.

Patched my version of the code by...
if(fillColor != null && !fillColor.Value.ToLower().Contains("infobackground") && !fillColor.Value.ToLower().Contains("yellow"))

if needed might be able to give a copy of the workbook after I strip the data from it...

Comments: Please attach a file that produces the error. Also, how do you reproduce manually it in Excel?

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>