Use the
ColorTranslator[
^] class instead of typecast. You'll have to use its
FromOle[
^] method in order to convert the
OLE color value to
GDI+ Color
. :)
[UPDATE]
ColorTranslator.FromOle
method requires an integer as parameter. So you'll need to convert from
Range.Font.Color
to
int
. Instead of using a typecast, try with
Convert.ToInt32[
^] method.
I've made a test and the following code works fine for me:
Excel.Range workingRangeCells = excelWorksheet.get_Range(range, Type.Missing);
System.Drawing.Color color = System.Drawing.ColorTranslator.FromOle(Convert.ToInt32(workingRangeCells.Font.Color));
[/UPDATE]
:)