I'm manipulating an excel file (using Interop). I'm trying to check the background color of a specific cell.
if (xlWorkSheet.Cells[1,j+1].Interior.Color == System.Drawing.Color.Red)
{
cell1.Interior.Color = System.Drawing.Color.Red;
}
'Operator '==' cannot be applied to operands of type 'double' and 'System.Drawing.Color
I'm not even sure If this error make sense because I have this code which I can use it just fine. So If I can assign, why can't I compare?
cellHeader.Interior.Color = System.Drawing.Color.Red;