Hi - I'm doing a proof of concept for my boss using the ClosedXML tool (cool stuff!!), but I'm running into some issues right off the bat having to do with accessing a cell's background color information. The BackgroundColor.Color property & subproperties
work fine on some cells but on others I'm getting a show-stopping error:
System.Collections.Generic.KeyNotFoundException was unhandled
Message="The given key was not present in the dictionary."
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
Perhaps due to the cell's color being set to default - maybe having no name at all? Maybe it's considered a Null. The cells I've found it seems to have a problem with (so far) have the "No Color" (Excel default) background color.
For my particular needs, I need to be able to distinguish cells based on their color - and I was hoping to use the .A, .R, .G, .B, Color.Name (or Hex information??) - all of which throw this exception on cells with a "No Color" background. Any
ideas on how to handle this?
-- Could this be a larger problem with ANY color which is not part of the Static member colors you have (AntiqueWhite, Aqua, etc)??
Thanks for your reply