Hello, I am using version 7.5 and trying to use the CreateXYChart user object from the excel menu to create a chart. I am getting a VEE Run Time Error
"Error with line chart settings Names array. Probably cause is array not as large as data array. Also verify if you selected logarithmic, there are no negative data values"
I haven't selected logarithmic. To select the data for the chart, I am using the xlLib.DataFromCells function to pull data from an excel spreadsheet. My input to that function is text of the form A23:F423.
I get that same error for any range of input columns I try except when I use A23:B423. In that case, no error shows up, but when I look at the plot nothing is visible. When I check its source data, it seems to be using only a single point: A423 for the x data and B423 for the y data instead of plotting all 401 data points.
Any ideas as to what the problem is here or what I can do to fix it. I've looked at the example program for creating an xyChart and I don't see many differences between that example and what I'm trying to do.
Thank you for your assistance!
"Error with line chart settings Names array. Probably cause is array not as large as data array. Also verify if you selected logarithmic, there are no negative data values"
I haven't selected logarithmic. To select the data for the chart, I am using the xlLib.DataFromCells function to pull data from an excel spreadsheet. My input to that function is text of the form A23:F423.
I get that same error for any range of input columns I try except when I use A23:B423. In that case, no error shows up, but when I look at the plot nothing is visible. When I check its source data, it seems to be using only a single point: A423 for the x data and B423 for the y data instead of plotting all 401 data points.
Any ideas as to what the problem is here or what I can do to fix it. I've looked at the example program for creating an xyChart and I don't see many differences between that example and what I'm trying to do.
Thank you for your assistance!
Having another issue on the other one (getting an error from the chart object itself) which I think may be due to not having some updated library? When I try to run the example program, there is a runtime error "Get of property 'select' in the referenced ActiveX object failed" Error number 552.
If so, then stick with the "CreateXYChart" in the Excel drop-down. I don't use those libraries, but your problem is probably that it can only handle one series at a time. Whereas you're trying to push 6 series at a time (A thru F). Right idea though.
If not, screw the Excel drop down. Device > .NET Assembly Reference > COM tab > Microsoft Excel XX.0 Object Library.
Then, Import the "Microsoft.Office.Interop.Excel" Namespace so you can declare some objects. Data > Variable > Declare Variable > Type: Object, Sub Type: COM > Edit: Excel Application.
Now you have a handle on Excel 2007. I won't go into more detail if you don't care, but I can chop up an example to create some charts this way.
Sometimes I get the error "Error with line chart settings Names array. Probably cause is array not as large as data array. Also verify if you selected logarithmic, there are no negative data values" if I am providing a 2D array to a line chart.
As for your "but when I look at the plot nothing is visible", I am not sure if this has something to do with Excel 2007 text and number conversion. Please see "error.jpg" attached.
Hope this helps
Attachments
In lieu of the problem persisting, I'll try to whittle down my program (been working on for months) into an example for charting from a worksheet array.
PS: 401 pts of data? ESA spectrum analyzer perhaps?
Be warned, it's certainly not the easiest way, but it will ultimately give you the most control over Excel.
The other computer, which is the laptop I'm using in the lab to control instruments, has excel 2007 and I am still getting a run time error there. When I try to run the example XYChart program, I get error number 552: "GET of property 'Select' in the referenced ActiveX object failed"
Is there some library or file that perhaps needs to be installed or updated? Both computers have Vee 7.5 and IO library Suite 15.5.
Thank you.
Just delete the line:
It's probably unnecessary anyway. However, if that doesn't work, then you may run into other problems. As far as correct libraries, IO 15.5 is the latest, but I wrote the example in VEE 9.0. I set the execution mode to VEE 6 & 7 for you so everything would work right...
Good luck