From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel chart color problem using ActiveX (not RGT).

Solved!
Go to solution

I am inserting Excel charts into an Excel sheet using ActiveX (not using RGT at all).

The subVI below shows how I format the Chart and Plot Areas. The colors produced on the Excel chart completely don't match what I choose. Yellow comes out as blue, and so on.

 

 

Excel Plots Incorrect Color.png

0 Kudos
Message 1 of 7
(3,199 Views)

I think you are doing it backward.  Try this.

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 7
(3,187 Views)
Solution
Accepted by topic author murchak

Actually it may just be the way colors are defined in Labview versus Excel.  If what I suggested above doesn't work, there is a VI called Convert OLE Color that may give you the right color.  Use Ctrl + Space to search for the VI. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 7
(3,179 Views)

Thank you! Covert OLE Color did the trick. I played around with your first suggestion with no luck. I am not entirely sure if I was doing it backwards. My original formatting subVI worked with some of the colors, but other colors didn't turn out right. I supposed if I did backwards, it would not work with any color. 

0 Kudos
Message 4 of 7
(3,160 Views)

I wasn't really sure if it was backwards either.  I was thinking that the color object had to be defined first and then passed as input.  Does it work either way?  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 7
(3,108 Views)

LabVIEW color are 00 RR GG BB and Excel color are 00 BB GG RR so basically what the Convert OLE Color vi do is swap the RR and BB bytes. It could have been done like this also:

color swap.pngBen64

 

Message 6 of 7
(3,102 Views)

Hi Ben, Aputman,

 

There was a forum post yesterday for people to post little nuggets of knowledge on anything they had learned or found useful. You are guys are LabVIEW experts and solving an issue like color mismatch between LabVIEW and Excel is trivial for you. But I bet if you post the solutions you offered here in that post, a lot of newbies like myself would find it quite useful. There are a lot of people who use LabVIEW to interact with MS Office. I can imagine this issue would pop up again and again. 

0 Kudos
Message 7 of 7
(3,088 Views)