LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
lsn

Standardising the color constants in Labview and Excel

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

In my project, I wanted to set the cell color in excel as red during a failure condition. But to my surprise I found that the color was set to blue and NOT red.It took me a long time to understand that the hexadecimal values for the color constants are different in Labview and MS Excel.

I wonder why the color constants are not standardised, when Labview supports features like ActiveX controls. 

9 Comments
AristosQueue (NI)
NI Employee (retired)
I am afraid we need more information to know what you're referring to. LabVIEW doesn't have any color constants in its palettes other than black, and we use the standard RGB encoding used by every program I can name, including MS Excel. What are you referring to? Can you post a link to VIs that demonstrate the issue?
Darren
Proven Zealot

A good example of this discrepancy is shown in the following VI (requires Report Generation Toolkit to be installed):

 

vi.lib\addons\_office\excel.llb\Excel Set Cell Color and Border.vi

 

Notice that we use a conversion VI to convert the LabVIEW color to a value that is compatible with Excel.  I think the difference has to do with the ActiveX interface to Excel.

 

-D

Intaris
Proven Zealot

I must give my 2c and say that I don't want LV to change it's behaviour to suit Excel or any other MS product.

 

I'd love to see a report generation toolkit for OpenOffice (Cross-platform).....

 

Shane.

altenbach
Knight of NI

Could it be a byte order issue?

Darren
Proven Zealot

Yes, it's a byte order issue.  Here's what the code in the color conversion subVI looks like:

 

color_byte_order.png

 

-D

joshuatree
Member

and i just came across this post and the docs that explain it:

 

http://digital.ni.com/public.nsf/allkb/F723BCD6B139C5038625754A00326B17 

 

 As Darren pointed out: the RGB and BGR are swapped...  who's right?    it's annoying anyway.

Message Edited by joshuatree on 09-02-2009 01:53 PM
Intaris
Proven Zealot
Eh, chances are Microsoft isn't the one who's right.....
G-Money
NI Employee (retired)

I'm afraid that we are staring at two giants (NI and Microsoft) doing their own thing and it would be hard for either to change because of the large user base depending on those remaining the same.

 

Isn,

 

      Do you think the conversion technique that Darren pointed out is an accpetable workaround or would you like your idea of NI switching to MS byte order to still live on?

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.