From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Error when adding a Title to a Graph in Excel

I am trying to automate adding a graph to Excel.  The Easy Graph.vi is too simple for what I would like to do.

 

I recorded a macro of what I wanted to do, and then I copied it in LabVIEW basically.

 

My program is erroring out every time I try to modify anything on the chart (title, series values, series names, etc).

 

I cannot figure out why it will allow me to add a sheet, add the chart, rename the sheet, and then error out when I continue to use the Excel._Chart properties and methods.

 

I attached a sample file and my code.

 

Thanks

Kenny

Download All
0 Kudos
Message 1 of 5
(2,470 Views)

Can you create the graph without error?

Tim
GHSP
0 Kudos
Message 2 of 5
(2,465 Views)

Here is an example of the chart wizzard that I help someone else with. It allows you to set up your graph titles and axis. I have never had to upgrade this feature from MS excel 2000 - 2007

 

http://forums.ni.com/t5/LabVIEW/labview-excel-2007-Axis-title/td-p/1226794

Tim
GHSP
0 Kudos
Message 3 of 5
(2,464 Views)

Ok, I figured out my issue.

 

It seems that you have to graph the data, before you can change any graph attributes, even though I have done that before.

 

Once I put the axis, title, etc after the graphing, then it worked.  Well, I also had specified my range wrong, so that errored out too.

 

Thank you for the help.

 

Also, how to you get a reference to the Chart Wizard through the excel activex?

Kenny

0 Kudos
Message 4 of 5
(2,444 Views)

 


@Kenny K wrote:

Ok, I figured out my issue.

 

It seems that you have to graph the data, before you can change any graph attributes, even though I have done that before.

 

Once I put the axis, title, etc after the graphing, then it worked.  Well, I also had specified my range wrong, so that errored out too.

 

Thank you for the help.

 

Also, how to you get a reference to the Chart Wizard through the excel activex?


I posted a snippet. You can take it from there. I do not remember how I got it before. I have not had to change it in six to seven years. I remember going through the MSDN and found the function. I think I made it from scratch to match the MSDN..

 

Tim
GHSP
0 Kudos
Message 5 of 5
(2,431 Views)