Showing results for 
Search instead for 
Did you mean: 

spreadsheet formatting-same sheet different tabs??

Hi all! Just had the most wonderful expience getting my data to save with a spreadsheet. Now, for a more challenging task.



Here's what I have right now:

- One Vi will write my data to the following sheet:



-Another writes to the following sheet:

(Test 4.xls)


My question is how to tell LV to write to the same sheet, but each test on sperate tabs?


Let me know what info I need to supplier. I know this can be done.



Download All
0 Kudos
Message 1 of 15

Hi Chris23892,

how do you write your data now? You have to use ActiveX to write your data to one file into different sheets.



0 Kudos
Message 2 of 15
no, using the write to spreedsheet function in each VI. I'm assuming there's either a way to format this to write the data or a sub VI I'll have to build and pass my data through to do all of this?
0 Kudos
Message 3 of 15

The write to spreadsheet VIs write an ASCII file that is considered standard for spreadsheet programs, only data, no calculations or multiple sheets.


If you want to write to multiple sheets you should use ActiveX, the NI toolkit for MS Office deals with this stuff quite nice.




Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 15
Can I get an example? The one I'm using from the LV examples is not working very well.
0 Kudos
Message 5 of 15
here's what I have so far. Our course, I do not have any data coming into the input cluster, but if I did, how do I get this to work? I do not need my rows labled, so I left that out.
0 Kudos
Message 6 of 15

Chris23892 wrote:
Can I get an example? The one I'm using from the LV examples is not working very well.

What's not working well about it? The way it's writing, or the way you're formatting the data? The example you're using is designed to open Excel, with a new workbook, and to add a sheet. If you run it again you'll get a new workbook, which is probably not what you want. You want to add a sheet for your other set of data to a workbook. You can find lots of examples in the Excel thread


Also, I don't quite understand what you're doing with the Reshape Array function. It seems to me that all you need to do is to use a Build Array function there to get a 2D array.

0 Kudos
Message 7 of 15

frastrating, I tell you. I know exacly what I waht to do , but can't find out how.


All I want to do is take one of my tests, dump it to a tab in excel (with the test name in the columb) and on the next tab, have the data for another LV test. These boards are confusing to a new guy

0 Kudos
Message 8 of 15

Believe us, it's not our intent to try to confuse you. Smiley Wink Also, keep in mind that you are dealing with Excel's ActiveX interface, which Microsoft designed and defined, so you can't really blame NI for Microsoft "method of madness". Smiley Very Happy


You almost have all the pieces, but in order to close the loop you'll need to provide a few clarifications and additional details. You said you want to write the test results to separate sheets. You also said you wanted the test name "in the column". Which column? Or, are you trying to name the sheet to be the test name? Also, in what way do you need to have the workbooks named? Do you have individual test runs that run a suite of tests (with each test in its own sheet), and then all of that saved to a workbook?


Assuming you want to save the test name as the sheet name, and each test has its own set of data results, you could do something like the attached example. Modify as needed.

Download All
Message 9 of 15
Wow. A bit a tweeking and this worked. I'll play a bit and post back. Now this makes sence. Thanks
0 Kudos
Message 10 of 15