LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use write to spreadsheet VI to export data to excel?

Solved!
Go to solution

Hi all,

 

Currently I am using NI USB 6255 to acquire data from a power supply.

 

I would like to collect the voltage of the power supply at every seconds. Currently, I am able to do so if the file path is to a .txt file. However, I want to record all my data directly into excel. Does anyone knows how to do it? I appreciate you help very much.

 

Hereby I attached my vi. A million thanks!

 

Regards,

Vanessa

0 Kudos
Message 1 of 27
(25,886 Views)
Solution
Accepted by topic author VanessaWen

Hi Vanessa,

 

WriteToSpreadsheetFile does what it's name implies: it writes data to spreadsheet files.

Excel can open these spreadsheet files, when the measurement has finished.

 

When you want to input "live" data into an Excel sheet you need to use ActiveX remote control of an Excel application. You will find examples in the forum, it may be worth to look for that special Excel thread

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 27
(25,883 Views)
Solution
Accepted by topic author VanessaWen

I would do something like this if the rate of data recording is as slow as you said.

 

DAQ_defined channel_record to excel_2.png

-----

The best solution is the one you find it by yourself
Message 3 of 27
(25,877 Views)

If you want a true xlsx file, then try using the Write Measurement File express VI.  It doesn't look like it uses ActiveX, but it will write files in the xlsx format.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 4 of 27
(25,860 Views)

Hi GerdW,

 

Perhaps my question is not clear enough. Yup, I want to view my data after the programme has stopped. When I tried to open using Excel file, it says the data is unrecognizable. However, if I open using a text file, I could see my data clearly.

 

In that case, what changes should I made to my current program?

 

Thank you so much!

 

Regards,

Xin Wen

0 Kudos
Message 5 of 27
(25,839 Views)

Two comments:

 

  1. Use the timestamp from your data acquisition instead of getting it from the operating system. If you convert your data to a waveform instead of an array, the first element of the waveform is the timestamp. This will give you much more accurate information.
  2. I would not recommend using the Excel version of Write to Measurement File for streaming data. It does not use ActiveX, but it is an XLSX format, which is a zipped set of XML files. Every time it writes, it unzips, adds data, then zips again. This is VERY slow. It is useful for writing static sets of data, but you are much better off with a tab separated text file if you want to stream a spreadsheet compatible file to disk. Excel reads tab separated text files with no issues (and so does Gnumeric, OpenOffice/LibreOffice Calc, Mathematica, and virtually every other analysis program on the planet).
This account is no longer active. Contact ShadesOfGray for current posts and information.
0 Kudos
Message 6 of 27
(25,840 Views)

Hi Anand,

 

My problem is not the rate of data recording. I am unable to retrieve my data using Excel.

 

Vanessa

0 Kudos
Message 7 of 27
(25,834 Views)

If you save the data as a .csv file as I have shown in my example, I am sure you will be able to open the file using Excel. I do it all the time.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 27
(25,830 Views)

Hi Anand,

 

Do you mind to share your vi? I couldn't find some of the block. I am still learning LabVIEW anyway. Thanks! Smiley Happy

 

Vanessa

0 Kudos
Message 9 of 27
(25,822 Views)

Hi Anand,

 

Do you mind to tell me what is the array block (whereby the output is connected to write to text file) you have used in your design? I really appreciate your help. Thanks!

 

Vanessa

0 Kudos
Message 10 of 27
(25,679 Views)