I have an excel sheet with some cells having some background color. I need this color in html code and hence I want to convert Excel.Range.Interior.Color to RGB format or System.Drawing.Color.
After doing that i would be using System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color) to get color to be used in html tags.
I tried doing following:
Excel.Range r = (Excel.Range)m_objRange[2, 2];
System.ComponentModel.TypeConverter converter = System.ComponentModel.TypeDescriptor.GetConverter(r.Interior.Color);
MessageBox.Show(""+converter.ConvertTo(r.Interior.Color,typeof(System.Drawing.Color)));
But i get an error that i cannot convert System.Double to System.Drawing.Color