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,924 Views)

Can you create the graph without error?

Tim
GHSP
0 Kudos
Message 2 of 5
(2,919 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,918 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,898 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,885 Views)