LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How I can save an existed Table "exactly" into an Excel or a Text file?

I am able to save from a Table into an Excel file, but I could not put in it the following:

a)Column Headers

b)First column should be integer

c)The Scientific notation (supposed to be with 6 decimal point) but it shows only two decimal point

d)In the last 3 rows, it couldn't understand --> it showed Zero's

***> It shows better when I changed the data.xls to data.txt ... only solved c)

***> You cam modify completely how to write into the Excel or Text file ... but do not change the way I write to the TABLE (I have "no choice" to keep it that way!)
0 Kudos
Message 1 of 5
(3,142 Views)
First of all, the Write to Spreadsheet File function does not create an Excel file. It creates a text file with values separated by a delimiter. Excel is capable of recognizing tabs and commas as delimiters and will convert the text into a spreadsheet.

Most of your problems can be solved by converting Write to Spreadsheet to accept arrays of strings instead of arrays of numbers and adding the column headers to the array. You'll probably have to experiment with the Excel import function as well.

Thye best way, however to get exactly what you want into Excel is to use ActiveX. There is an example the4 comes with LabVIEW that shows some of the basics. You can find other examples by searching the Developers Zone. NI also sells a toolkit for reading/
writing Excel and Word files.
Message 2 of 5
(3,143 Views)
Thank you Dennis, it does not solve all my requirements but much much improve from my way. You are right, it can be done 90% with the example of ActiveX ... but I still do not have the format I like, and I could not "naming" the Excel file (default Book 1) as I wanted ... but I will try more later!

Thanks for your advice!
0 Kudos
Message 3 of 5
(3,142 Views)
Dennis, with the "Write table to XL"vi. is it possible to rearrange somehow so that i can add the "create,open, replace" vi.

I have a 2D string table that outputs from a while loop. I would like to then have a pop-up 2 button dialogue to either save or quit. If save is selected, i then want user inputs for serial number and file destination(create,open, replace?) then close. I had problems linking the refnum into the existing example.

Any ideas?
0 Kudos
Message 4 of 5
(3,086 Views)
Sorry, i forgot to say that i need the row,column headers attached too.
0 Kudos
Message 5 of 5
(3,083 Views)