Showing results for 
Search instead for 
Did you mean: 

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

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!




0 Kudos
Message 1 of 27
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,
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 27
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

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.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 4 of 27

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!



Xin Wen

0 Kudos
Message 5 of 27

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

Hi Anand,


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



0 Kudos
Message 7 of 27

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

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



0 Kudos
Message 9 of 27

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!



0 Kudos
Message 10 of 27