LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export an array to excel sheet

Solved!
Go to solution

Hi all, 

 

when I Export the data (ID array) from LabView to an Excel. Basically, I need the data to be inserted to a same Excel sheet every time (in the next row) when I press run and doesn't open a new sheet. Any suggestions and ideas are welcome

0 Kudos
Message 1 of 12
(12,928 Views)

Are you talking about Exporting using the right click menu?

 

I don't think there is a way to do that.  It always creates a new sheet because it has no way of knowing where you want to put the data to.

But once it does create the new sheet, then you can copy and paste the data to where you want it to go.  Create a global macro to do that for you with a shortcut key.

0 Kudos
Message 2 of 12
(12,892 Views)

@Al-rawachy wrote:

Hi all, 

 

when I Export the data (ID array) from LabView to an Excel. Basically, I need the data to be inserted to a same Excel sheet every time (in the next row) when I press run and doesn't open a new sheet. Any suggestions and ideas are welcome


Is this an actual Excel file (.xls or .xlsx) or is it simply a text file that Excel will open by default like a .csv?

 

If it is the later then something like this should work:

xl.png

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 12
(12,877 Views)

If you had attached your VI, we would be able to quickly give you a helpful answer.  Many Forum users talk about an "Excel sheet", and most mean what LabVIEW calls a "Delimited Spreadsheet File", a file with the .csv extension (in other works, a text file), while others mean a File adhering to the Microsoft Excel format with an extension of .xls or .xlsx.

 

We'd also understand what you mean by a 1D Array of Data (strings? Floats? Clusters?).

 

So how about it?  Attach a .VI file with your code, and you'll get a pretty speedy (and probably correct) response that addresses your question without us having to "guess" what you mean.

 

Bob Schor

0 Kudos
Message 4 of 12
(12,871 Views)

HEllo Guys,

 

First of all, I would like to apologise for this misunderstanding, I didn't attached the Vi because it is really complicated and I need only simple 1D floated array exported into an excel sheet .xlsx and at each time when I do execute to the program i need to save it in the next row of the same excel sheet. xlsx. Any advice? thanks for your patient 

 

Regards

0 Kudos
Message 5 of 12
(12,865 Views)

@Al-rawachy wrote:

HEllo Guys,

 

First of all, I would like to apologise for this misunderstanding, I didn't attached the Vi because it is really complicated and I need only simple 1D floated array exported into an excel sheet .xlsx and at each time when I do execute to the program i need to save it in the next row of the same excel sheet. xlsx. Any advice? thanks for your patient 

 

Regards


 

 

Don't make the end user right click and export graph data.

 

Write the graph data to a file at the same time you are plotting it to the screen.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 12
(12,855 Views)
Solution
Accepted by Al-rawachy

If you have the Report Generation Toolkit, this is a very simple process:

  • New Report, Excel, existing file as the "Template" file.
  • Function to go to Last Row.
  • Function to append table to report
  • Function to Save Report to file, using same File as when opened.
  • Function to close report.

I am not enclosing code, as I have no idea what version of LabVIEW you are using and you refused to post your code showing what you've tried.

 

Bob Schor

Message 7 of 12
(12,749 Views)

Thanks Bob,

 

Yeah you are right. 

0 Kudos
Message 8 of 12
(12,731 Views)

The only problem I have with this solution is that it requires adding a 2D array from everything I have tried. I don't know how he got it working with a 1D array.

 

Append Table to Report:  requires 2D array

Excel Easy Table:  requires 2D array

 

Is there an easy way? or do I need to do a macro activated within Excel or what?

 

 

Thanks,

Adepta_Sororitas

Download All
0 Kudos
Message 9 of 12
(4,700 Views)

Hello, Adepta.

 

If I am the "he" to whom you refer, you can pass a 1D Array (say of size N) through a Build Array function, changing it to a 2D Array of size (N, 1), perfect for Excel Easy Table (which I strongly recommend in place of Append Table to Report).

 

Bob Schor

0 Kudos
Message 10 of 12
(4,680 Views)