LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Excel Update Graph.vi

I'm having a bit of trouble. I added an XY chart to an Excel template and dressed it up a bit so it would look good.

Expecting to use 'Excel Update Graph.vi' to fill it with data points, I created a simple vi starting with 'New Report.vi'. After wiring in the 'Excel Update Graph', setting the graph index=0, supplying it with some imaginary data, and running the simple scenario, it returned an error code of -2146827284. Seeking more info I stepped into the 'Excel Update Graph', into a 'Call by Reference Node' which seemed to call up 'Excel_Update_Chart.vi'. Inside that is an 'Invoke Node' that takes in Excel._Worksheet and delivers an OLEObject. This is where it produces the error.

I have no idea what I just wrote, so I think
I need a simple example of using the 'Excel Update Graph.vi'. I couldn't find any in my documentation and in the support area.

Thanks for your time.
0 Kudos
Message 1 of 4
(3,520 Views)
Have you already created the worksheet for your project? I can't find any helpful information on that particular error code, but it sounds like you have certainly tracked it down to the source. Try following the Excel._Worksheet reference back to its source of origin and find if your application has a worksheet already created to send there. I have seen that issue before with some application. Users have created a workbook but no worksheet in it and then get odd errors becaues of that.
J.R. Allen
0 Kudos
Message 2 of 4
(3,518 Views)
I figured it out. When you create a chart/graph in Excel it asks for a data range or series to look at to create it's graph. Using the 'Excel Insert Graph.vi' the graph comes with a mini-spreadsheet called a DataSheet. This is where 'Excel Update Graph.vi' puts the updates.

I let 'Excel Insert Graph.vi' make a graph and then used it in my excel template file and 'Excel Update Graph.vi' talks to it fine.

Now if I can just figure out how Excel numbers the graphs in the template. It really screws up the object numbering when you copy and paste graphs. No problem, a little experimentation and I found the graph indexes of my 9 graphs.

Thanks again!
0 Kudos
Message 3 of 4
(3,518 Views)
Hi Ralph,

    Interesting because I was fiddling with the same thing.
    Glad you solved your problem but I didn't quite get the solution.
Although I did notice something new when I clicked on the graph generated by the
example a datasheet popped up. None of my charts do that so there's something
new to learn.
    I have a 'template' with a preformatted graph and I just want to expand the datarange
for the chart/graph.
    See if you can explain what you figured out so I get it.
    I don't want to generate a new chart because it seems I'll have to format it all over.
Seems like you were happy with your discovery but it's slightly subtile.
    I'm including the vi that I wrote that returns the same error you got.


                                                 Dave
                                                 dpersechini@verizon.net
0 Kudos
Message 4 of 4
(3,385 Views)