LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting data in excel from user specified cell

Hi

 

  I have a problem in implementing this logic.I'm using Active X for writing to excel. For writing to excel worksheet, Range of cells have to be written to the "Range Invoke node " as shown in the VI below.

 

For Example if I have a 4x4 array.

If the Input to the Range terminal is A2: D5 , then the array will be inserted in those range of cells.

 

But I have a condition in which the user willl choose only the cell from which he wants to start inserting the data.He won't specify the destination cell ie., D5

 

Since the user can choose any cell to start from say AA,BB or ZZ.Example, If the user specifies the starting cell as AA and if the Array 2x26 has to be written from AA then the destination column will be AZ, If its 2x46 then it will be BT.

 

 

What I wand is a logic to do this. So my inputs are the starting cell name and the 2d array,output is the destination column name.

 

The calculation of the destination Row is simple,I can add the no of rows in the 2d array after subtracting 1 from it  to the starting row number. The destination coulumn name is my concern.

 

It would be helpful if someone could make a sample vi with the logic.

 

Please  take a look at thePic attached to know were i want to put this logic.If the mode of selection is manual,the user will specify both the source and Destination cell(A2&D5), If its Auto only A2

 

Thanks in Advance

 

Regards

Temin

Download All
0 Kudos
Message 1 of 21
(3,362 Views)

I believe in the "Range Invoke node", "cell 1" requires upper-left cell and "cell 2" requires lower-right cell.

I'm not sure that's the solution.

regards.

0 Kudos
Message 2 of 21
(3,343 Views)

Cell 1 input has to be A1 : D4 for inserting a 4x4 array. If you write A1 to the terminal, It will write only in that particular cell.

 

Or else you can wire A1 to cell1 and D4 to cell 2. both does the same.

 

In both cases you need the destination cell name to fix the range.

 

Regards

Temin

 

0 Kudos
Message 3 of 21
(3,329 Views)

Have you tried this?

It's what I mean.

0 Kudos
Message 4 of 21
(3,325 Views)

ok sorry

0 Kudos
Message 5 of 21
(3,317 Views)

In my case the destination cell name is unknown so the question is how to fix the range?

 

My inputs are Starting cell(A2) and the 2d array.

 

So it comes to a point like I should read the no of columns in the 2d array. Then develop a logic to find the destination column name(D4) so that i can fix the range for that 2d array.

 

Regards

Temin

0 Kudos
Message 6 of 21
(3,315 Views)

No more answers Smiley Sad

0 Kudos
Message 7 of 21
(3,282 Views)

Have some patience. Meanwhile you can take a look at the free excel toolkit and some of the stuff you can do with it. Here, here and here.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 8 of 21
(3,280 Views)

.

0 Kudos
Message 9 of 21
(3,257 Views)

I can not upload the VI, but attached images of the code:

-The cases are not shown in imagesare empty
-The VI only supports up to cell ZZ

Download All
0 Kudos
Message 10 of 21
(3,215 Views)