09-18-2008 06:47 AM
Hi all,
I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
Now, how to do it at runtime through LabVIEW 8.0?
Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it.
It is tough since I don't know how to assign SourceData of the chart through labview.
I have attached chart's SourceData picture.
Hope you all can solve my problem.
The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
good is the name of the file.
The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
See the columns vary from A to F.
09-18-2008 10:57 AM
Are you asking how to do it using ActiveX, or how to use ActiveX to control Excel?
If it's the former, you need to use SetSourceData method. You can record a macro that does what you want and look at the macro code to see what you need to do. You can also search the web to find example code.
If it's the latter question, then you should start by looking in the LabVIEW Help at the topic "Using ActiveX with LabVIEW". You can also take a look at the KB article ActiveX and LabVIEW. There are also shipping examples for Excel. There is also the Excel thread with lots of examples.
09-19-2008 12:19 AM - edited 09-19-2008 12:20 AM
I know how to use ActiveX. But, the thing is, since it is running in to multiple columns I dont know how to set SourceData for many columns.
I will try the macro recording thing. Maybe I might nail something! Anyway, I will look into those excel areas you have given.
Thanks man.. smercurio_fc
09-19-2008 06:32 AM - edited 09-19-2008 06:33 AM
Ok i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
09-19-2008 06:38 AM - edited 09-19-2008 06:40 AM
But, stuck with another problem!
I am not able to name chart's X-axis and Y-axis.
Here is the figure,
09-19-2008 09:32 AM
09-22-2008 11:12 PM
Sorry about that. Theerror is related to converting the variant to data.
The error code is "Error -2147352571 occurred at Variant To Data"
I will try it in NI error database. Just in case you can find out about the wiring issue. Maybe I have wired wrongly.
09-23-2008 09:58 AM
07-21-2011 10:15 AM - edited 07-21-2011 10:16 AM
Hi Folks,
I am trying to add new series into a Excel chart dynamically using ActiveX and ran across this post. According to "Microsoft Office Excel 2003 Visual Basic Reference" (vbaxl10.chm), there exists a NEW Series method for Seriescollection object. However, after casting type the seriescollection, I can only find the available methods as follows:
Add, Application, Extend, Item, Paste.
I did not see the NEW Series method as shown in this post. Please help how to wire this "new series" method.
thanks much!
07-21-2011 12:55 PM - edited 07-21-2011 12:56 PM
Odd. I see it:
How are you creating the SeriesCollection object?