LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Excel

Solved!
Go to solution
Solution
Accepted by topic author SparkEE
Of course you are getting only one value because that is what you are passing out of the while loop. You can enable auto-indexing to create an array but do NOT do this with dynamic data. Convert to something real such as a scalar inside the loop.

And please, since you are not writing an Excel file, do not use an xls extension.
Message 21 of 24
(1,162 Views)

I see from the code you posted that you are using NI's "Write to Spreadsheet" function.  What JeanLuc and I have been discussing is the Report Generator Toolkit in LabVIEW which works with Excel and reads/writes to Excel -- quite different.  I believe (but will admit I've never used it, nor am I likely to) that the Write to Spreadsheet function writes basically a text file that follows the .CSV (comma-separated values) format which Excel can read.  If that's the case, you could always "roll your own".  Alternatively, to accomplish your goal (which I believe is updating existing Spreadsheet files, either adding or replacing data), consider doing the following:

  1. Read the existing file and save the data in a suitable data structure (say, an array).
  2. Gather the new data, perhaps with DAQ Assistant.
  3. Combine the new data and the existing data as appropriate (append, replace, whatever).
  4. Write the combined data to a new file, or overwrite the old file.

Bob Schor

0 Kudos
Message 22 of 24
(1,134 Views)

@Bob_Schor wrote:

I believe (but will admit I've never used it, nor am I likely to) that the Write to Spreadsheet function writes basically a text file that follows the .CSV (comma-separated values) format which Excel can read..


Not quite, but good enough for newbies to understand.  The Write To Spreadsheet File just writes a delimited text file.  By default, a tab is used as the delimiter.  I you save a file as a text file (*.txt) and open it in Excel, Excel will open it just fine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 23 of 24
(1,128 Views)

Thanks to everyone, I appreciate all input.

Kudos to Jean and Dennis Smiley Wink

0 Kudos
Message 24 of 24
(1,108 Views)