LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activeX and Excel Charts

Just a background, my excel file has 2 sheets, the first sheet is just the chart... no cells or anything... just chart. My second sheet contains the data. The chart is updated from the data on the second sheet.
0 Kudos
Message 11 of 18
(1,552 Views)
What  you are trying to use is the excel toolkit at least that is what it looks like in the PIC. Have a look in the breakpoint discussion forum in the excel board. In this board there are a lot of VI's that I and many others have posted. Look at how they are done and if you still have questions I will do my best to help you.
 
There is a VI in toolkit that I posted that deals directly with graphs.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 12 of 18
(1,548 Views)
Thanks for the reply,

I don't think what I have is the toolkit, it was from a library that someone posted that i found on another one of my excel dilema journies.

If the toolkit is free, then I probably have the toolkit.

Ill check out the excel forums and see what I can come up with... my patience is running very short on this little project. I get very frustrated when the problem should be easy to solve, yet it takes 134234235114 hours to figure out. Smiley Indifferent
0 Kudos
Message 13 of 18
(1,531 Views)
Well... so far, I have figured out my first problem... when naming sheets, dont use "-" in the name..... although excel seems fine with it... labview doesnt like it.

Whenever I would go to select the sheet to change the name or do anything for that matter.... I would get errors all over with a name like HB-XX-XX ....... but on the flipside.... just the name XX worked fine.... GRRRRRR Smiley Mad

the journey to the next error continues.
0 Kudos
Message 14 of 18
(1,527 Views)
Well that didn't take long.... new problem!

When a chart is on its on worksheet.. NOT posted as an object... is that still technically considered a worksheet?

This is the problem Im having... Everything runs great, fine, no errors... until I go to switch the active sheet, the Activate method for a Worksheet invoke node throws an error.

Here is an overall picture of my program, and a detail of the error Im receiving when going to switch the active sheet.
Download All
0 Kudos
Message 15 of 18
(1,522 Views)
The VI posted earlier only works on a ChartObject (chart floating on a worksheet).  If you need to work with a separate chart, then select it as a Sheet or a Chart.  Your workbook contains two Sheets, only one Worksheet and one Chart.
 
 Your code for that seems correct, but try replacing the Type input on the Variant to Data with an Excel.Worksheet control.  The error indicates a bad reference and occurs the first time that reference is used.
 
Activeworkbook.Sheets("Curve").ChartTitle.Text = "New Title"
or
Activeworkbook.Charts("Curve").ChartTitle.Text = "New Title"
 
or for Excel 2003:
Activeworkbook.Sheets("Curve").ChartTitle.Characters.Text = "New Title"
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 16 of 18
(1,513 Views)
Thanks a bunch... I knew it was some sort of reference error, but I wasn't sure how excel handled that chart on the seperate sheet considering it's not posted on the sheet as an object.... Im gonna play with it in a little bit, I got some other work to do in the meantime.... and this stuff is giving me a headache. Smiley Sad
0 Kudos
Message 17 of 18
(1,510 Views)
WOOO HOOO!!

Did it... Thanks to the sutbtle but VERY effective tips ( Thanks Michael ) .. Sometimes all it takes is a tiny spark, to get the fire going again.

My ultimate problem was I was trying to treat the chart as a worksheet... but when I chart is on its own page... and NOT in a worksheet as an object... this doesnt work. Found out the chart in itself, is its own entity.

I selected the chart by activating it ( before I was activating the worksheet, which I thought the chart was on... instead of just activating the chart itself Smiley Indifferent )  Activating the chart made it become the "ActiveChart" which I could then reference easily and viola!! access to the chart... YAY!

First picture is how I selected the chart from the workbook... and the second is how I access the chart to change the chart title.... but now with my new found epiphany, I can modify the graph to my hearts desire...

Thanks again for the help... this was a great start to my weekend... My headache feels better already. Smiley Very Happy

Cheers,

Matt Brehm

Message Edited by MJBrehm on 08-18-2006 03:29 PM

Download All
0 Kudos
Message 18 of 18
(1,502 Views)