LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing array to Excel with ActiveX

Solved!
Go to solution

Common question I suppose, but I'm still having issues despite reading several posts about the issue.

 

Problem is I'm trying to write a 1D array of data to 1 column in an excel document. However, unless I add an artificial column (of blank values or some other bogus #), ActiveX only writes the 1st value of my array to the column.

 

Look at the attached. In Picture 1 I add an articial column and everything writes fine. In Picture 2 I don't add this column and only the 1st value of the array gets written in each row.

 

Suggestions?

 

Thank you.

0 Kudos
Message 1 of 5
(5,071 Views)

The wiring in Picture 1 is unclear.  There is a wire junction that is hidden behind the transpose array function.  Is the 2-D array going to Excel coming from the 2-D array before or after the transpose array?

0 Kudos
Message 2 of 5
(5,064 Views)

The transposed array is sent to the junction.

0 Kudos
Message 3 of 5
(5,058 Views)
Solution
Accepted by topic author ap8888

I haven't done much with Excel and LabVIEW by way of ActiveX.  Creating a small VI and duplicating what you show in your screenshot, I see the same behavior.

 

I believe that Excel interprets a 1-D array as something that runs horizontally.  So a 1-D array consists of a single row of cells and N number of columns.

(Actually LabVIEW interprets a 1-D array like this as well, but it allows you to show an array onscreen either vertically or horizontally.)

 

Converting to a 2-D array and transposing is what you need to do to have that 1-D array be treated as a single column of cells.

 

Note that you don't have to use build array and append an empty array to it.  You can just use build array as is and it will turn a 1-D array into a 2-D array.

 

Message 4 of 5
(5,048 Views)

Seems that did the trick Ravens Fan.

 

1 more question (and yes I have tried other solutions online):

 

Is there a way to set the max/min limits on x/y axes on a chart in a given sheet? 

0 Kudos
Message 5 of 5
(5,032 Views)