06-18-2019 10:07 AM
I have a spreadsheet that uses conditional coloring if values are in spec. I am trying to use CVI to read the color. I am use the following:
error = Excel_GetProperty (ExcelInteriorHandle, &ErrorInfo, Excel_InteriorColorIndex, CAVT_VARIANT, varVariant);
For all the cells using conditional color formatting it returns a 38. On a cell that I manually set to green it returns 14. On cells with no color set it returns -4142. Is there some other way of determining the results from conditional coloring. I want the client to be able to modify the rules in the spreadsheet without me having to do any changes in my program.
06-20-2019 07:21 AM
Hi mjl,
That appears to be a limitation of the Excel Interior.ColorIndex property, which returns either the index of the color in the local palette or a constant called XlColorIndex that indicates either no color or automatic color. -4142 is no color.
It looks like there is a property called Interior.Color that returns the actual RGB color value as a variant that may be more useful to you.
Thanks,
06-20-2019 07:54 AM
Hi,
I tried using Excel_InteriorColor. In my code it returns a variant of type double always with the same value, 13551615.0. When converted to an ingteger gives 0x00CEC7FF in hex.
I'm also not sure how my post ended up here since I tried to start a new post.