From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Need help getting 2D array of strings into Excel.

Hello everyone. I have been looking through tutorials and posts trying to solve this problem and I would really appreciate it if someone could help me solve it.

 

The basic thing I want to do is:

 

I have a 2D array of string data. 

 

I need that 2D array of string data saved into an excel file.

 

 

Here is what I have right now and what I need.

 

I have been able to get a 2D array of NUMERIC data into excel using the "write to measurement file" function.

 

This gets it into a format that works and saves it in a way I can deal with. The issue is it only accepts numeric data, and my array of strings gets an error when I wire it to the function.

 

If there is a way to use a array of strings with the "write to measurement file" function that should solve my problem.

 

 

 

 

The next thing I have done is try the "export to excel" method that is a part of the 2D string of data. This actually gets all the data into excel in the exact way I need, but sadly I cannot automatically save that data to a specific file. Having to copy and paste the data will not work. 

 

 

I have attached a simple VI that has an example of what I have so far.

 

 

 

Lastly, I need more help than just a link to the tutorials about getting things into excel. I have spent a very long time reading the tutorial and I have not been able to get it to work. Most of the tutorial assumes you are using numeric data only, or does not specify how to do the same thing with string data. 

 

 

If someone could make a simple VI in which I can just insert my 2D array of strings and it will save it to excel I would be really really appreciate it. 

 

 

0 Kudos
Message 1 of 5
(3,279 Views)

Have you tried "Write to spreadsheet file" function?

0 Kudos
Message 2 of 5
(3,274 Views)

If you have the Report Generation Toolkit, this is (in my opinion) by far the easiest way to write data into Excel (open some of the functions and get Help from LabVIEW).  Note that Write to Spreadsheet does not open or write to Excel.  There are numerous examples, including several here in the forums in recent weeks.

 

Bob Schor

0 Kudos
Message 3 of 5
(3,262 Views)
I'm going to strongly disagree with that. The EASIEST way to create a native excel file is with the Write to Measurement File. The EASIEST way to create a file that excel can open is with the the Write to Spreadsheet File. Before you comment on how much the express function hides details, think about how much is hidden by lvoop and the actual ActiveX properties and methods that the report generation toolkit hides. The express function just adds one more layer on top. Unless there is a need for multiple sheets or including charts, I don't ever use native excel format.
Message 4 of 5
(3,254 Views)

To each his (or her) own.

 

BS

0 Kudos
Message 5 of 5
(3,239 Views)