From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export data and built graph in Excel

Hi

 

I am a beginner(use LV 7.1) and can’t cope with one issue. I’d pleased if anyone help me and provide me with more precise info.

I have to built a graph in Excel using data from VI. I’ve seen the Excel Macro example, but stuck using macros.

 

Thanks in advance.

 

 

0 Kudos
Message 1 of 5
(2,795 Views)
Can you provide a few more details as to your specific issue? Are you having trouble getting data into Excel, or running a macro, or not understanding the syntax of Excel macros? Are you actually trying to write a macro?
0 Kudos
Message 2 of 5
(2,786 Views)

Hello,

 

A simple way to do this is the Write to Spreadsheet File.vi. If you have the Report Generation toolkit however, we can better customize your report and use the express VI's that come with it. If you do have it, take a look at the Generate Report From Template (Excel).vi. Let us know how you want the data to appear.

 

Regards,

 

Anna K.

National Instruments
0 Kudos
Message 3 of 5
(2,749 Views)

I tried to write a macro in Excel, but didn't succeed. I don't have Report Generation toolkit.

 

to Anna K.: how can I cope with graph, using only Write to Spreadsheet File.vi?

 

and new problem: When I run the Excel Macro Example, Error 97 occurred at Unknown System Error in Set Cell Value with Range.vi->Excel Macro Example.vi.

0 Kudos
Message 4 of 5
(2,740 Views)

The Write to Spreadsheet File will generate a text file with delimited columns. This file can be opened by Excel, but it will not be an Excel workbook. Thus, you cannot add a graph to it unless you resave it as a workbook.

 

Error 97 is a null refnum.  This can happen if there was a problem opening Excel. Does Excel actually open and create a new workbook when you run the example?

 

If you need to save your data to an Excel workbook one thing you may want to consider is to use an Excel template that has a graph already in it. This way, you just need to update the cells with new data. 

 

The Excel API is a bit cumbersome. If you're going to need to do a lot of work with it, then I recommend looking over the Excel thread, as that has a lot of examples (including a user-created toolkit). 

 

0 Kudos
Message 5 of 5
(2,731 Views)