LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to write 2D array to specific colums/rows in excel

Solved!
Go to solution

I found a good LLB for retrieving a 2D array from specific cells from a specific worksheet and used that as a template to write to excel.  I just do not know how to actually get the data written down.  I've looked at the WriteToSpreadsheet VI but I do not see how i can write to a specific cell group.  Please advise and if there is a simplier way that would be appreciated as well.

0 Kudos
Message 1 of 18
(6,652 Views)

Check out this link and see if it is what you need.

 

http://zone.ni.com/devzone/cda/epd/p/id/4523

aputman
0 Kudos
Message 2 of 18
(6,635 Views)

i looked at that but didn't see how i could specify a starting column/row, i'm very new to LabView and it is probably easy to modify, I will spend some time on it and get back, thanks

0 Kudos
Message 3 of 18
(6,630 Views)

Rather than "get" the active cell, you will need to "set" the active cell.  In the example below, I am activating cell 1,1 which is converted to A1.

 

Capture.PNG

 

aputman
Message 4 of 18
(6,615 Views)

that looks easy enough, thanks

0 Kudos
Message 5 of 18
(6,612 Views)

i'm going to be calling this VI from TestStand so i tried to remove the event structure and set an active sheet, i also removed the "make visible" part for excel, i cannot seem to get my data to appear at all let alone in the correct cell

0 Kudos
Message 6 of 18
(6,601 Views)

You retrieved the sheet specified but did not select it (or do anything with it). Your code attempted to continue on the worksheet that was selected by default. Additionally, the code you were given is EXTREMELY slow for writing an array to a range. Use both the Cell1 and Cell2 properties to get a reference to the entire range then set the value, once. The attached VI should work and be considerably faster.

 

 

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 7 of 18
(6,596 Views)

i get this error code: -2146827284  Unknown System Error in ExportToExcel_new.vi out of the Worksheet invoke node that contains the cell range, i added a close to close the excel app (hopefully did it right)

0 Kudos
Message 8 of 18
(6,587 Views)

Don't use 0,0.  The cells start at 1,1.

aputman
0 Kudos
Message 9 of 18
(6,584 Views)

@aputman wrote:

Don't use 0,0.  The cells start at 1,1.




Good point, I presumed that either test stand was wiring in a non-zero value or the Convert Cell (that was not included) was handling that case. I also missed adding the array size to the start cell. See attached...

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 10 of 18
(6,579 Views)