取消
显示结果 
搜索替代 
您的意思是: 

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

下载全部
0 项奖励
1 条消息(共 5 条)
3,014 次查看

Can you create the graph without error?

Tim
GHSP
0 项奖励
2 条消息(共 5 条)
3,009 次查看

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 项奖励
3 条消息(共 5 条)
3,008 次查看

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 项奖励
4 条消息(共 5 条)
2,988 次查看

 


@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 项奖励
5 条消息(共 5 条)
2,975 次查看