LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i save data in Excel

Hi,

I want to save data in Excel? But how?

Can somebody send me a VI?

Thank you
0 Kudos
Message 1 of 11
(24,948 Views)
Hello james

The easiest way top do it is through the "Resport generation toolbox" from Ni, but it cost money.

The free way to do it is to use ActiveX automation since you can access any Excel book from there. You will find plenty of examples on this forum about that. Just dig in for 5 mins.

cheers
Pawel
0 Kudos
Message 2 of 11
(24,937 Views)
Do you have an example?

Thanks
0 Kudos
Message 3 of 11
(24,934 Views)
hi,

On top of that, saving data as *.csv could be alternative solution

1. Format your data into string and seprate them by comma
2. Save the data as filname.csv using the "write character to file.vi"

You should be able to port the saved *.csv file in Excel.

Hope this helps!

Cheers,
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 4 of 11
(24,925 Views)
Hi james

A little bit simpler than save the data as csv-file and import it into Excel, would be to save it just as .xls file.

Just write a normal text-file with ending .xls.

I always use this way if I want to save data and analyse it in Excel.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 5 of 11
(24,919 Views)
James, here is a LV 6.1 VI that writes a data array to excel,

Dave.
0 Kudos
Message 6 of 11
(24,916 Views)
Use the Write To Spreadsheet function. Piece of cake.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 7 of 11
(24,899 Views)
If you want to do excel formatting and really have full functionality in Excel without having to buy the reports toolkit, you can use the Excel ActiveX controls. If you have Excel installed you can use ActiveX references to do anything you want excel to do for you. Use an automation reference and select the Excel class. I forget what its called, but you should be able to find what does what without too much problem. You just use methods from the reference. It takes a bit of work to figure out what everything does, but I have written huge formatting vi's that open excel, format cells, run macros, and save files in excel and then close excel when its done. It all depends on how fancy you want to get.
-Devin
I got 99 problems but 8.6 ain't one.
Message 8 of 11
(24,881 Views)

If you are using the DDE.llb functions, it is quite simple.  The command is simply [SAVE}.  Here is how it would look

 

 (I am not able to paste the DDE functions onto this page): You would insert an OPEN Open Conversation.vi.  To this,

 

wire the SERVER, which would be the constant EXCEL.  Wire theTOPIC, which would be your file name including .xls. 

 

Next, insert a DDE Execute.vi.  Wire [SAVE} to the COMMAND input.  And then insert a DDE Close Conversation.vi.

 

Be sure to wire all input/output conversation refnums from OPEN Open Conversation.vi to DDE Execute.vi to DDE

 

Close Conversation.vi.

0 Kudos
Message 9 of 11
(12,768 Views)

???Smiley Frustrated  You're responding to an 8 year old post...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 10 of 11
(12,763 Views)