LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

get pixel location from table cell coordinates

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.

0 Kudos
Message 1 of 3
(2,112 Views)

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,

 

Michael B.
Product Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,079 Views)

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.

0 Kudos
Message 3 of 3
(2,068 Views)