LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on saving to different worksheets on excel.

How can I save data as I loop through a program, and save the data generated in different worksheets on one excel file, without using activex?
0 Kudos
Message 1 of 4
(3,028 Views)
You can't. When Excel opens a text file it puts it in a single worksheet. Open another text file and it puts in is a single workseet in another Excel file.

The only way to get that level of control over Excel is to use ActiveX. The good news, though, is that the interface to Excel is easy to use and there are excellent examples that ship with LV.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 4
(3,027 Views)
You have two other choices that do not use ActiveX.

1. If you write continuous data that exceeds the maximum number of rows in Excel, you can still read the data using an Excel macro. Using the ReadLine method, you can parse the data into cells and skip to the next worksheet when the row limit is reached or using any token that you want (ie. blank line).

2. If you have Excel 2000 or later, writing your data as an XML file will allow you to format the data into worksheets. This will increase the file size dramatically. To do this you have to write the required header and then maintain the proper heirarchy of Workbook, Worksheet, Table, Row, Cell and Data. Save a simple data file as XML to see the file format.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 3 of 4
(3,028 Views)
'To do this you have to write the required header and then maintain the proper heirarchy of Workbook, Worksheet, Table, Row, Cell and Data. Save a simple data file as XML to see the file format. '
 
may i know how do u change the format of the xml file? cos rite now im using tis example code i found in labview 7.1 'read data from xml file' and i wanted to change the headers of the file format shown in excel.
0 Kudos
Message 4 of 4
(2,887 Views)