LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ranges in Excel

Hi,
I am sending data to excel using the invoke node with worksheet and
range methods present. This allows me to dump a whole array into excel
providing I input the range of cells which I want the data to be sent to
i.e. A1:J4. The problem I have is that I want to be able to read in
variable size arrays and dump these to excel at the press of a Boolean
without having to enter the cell ranges all the time. Is there any way you
can convert array dimensions into cell ranges automatically, I would be
grateful for any advice.

Regards,
Martin.
0 Kudos
Message 1 of 3
(3,463 Views)
Hi Martin

You should be able to format a string that will generate this range form the results of the array length function. The only
difficult bit would be converting a number from 0-25 to A-Z but this not to hard since the ASCII value for 'A' is 65 and the ASCII
value for 'Z' is 90, so A-Z can be generated from 0-25 by just adding 65 to them and converting with the 'Byte Array to String'
function or using the format string escape codes.

Tim

Martin Stanley wrote:

> Hi,
> I am sending data to excel using the invoke node with worksheet and
> range methods present. This allows me to dump a whole array into excel
> providing I input the range of cells which I want the data to be sent to
> i.e. A1:J4. The problem I have is that I want to be able to read
in
> variable size arrays and dump these to excel at the press of a Boolean
> without having to enter the cell ranges all the time. Is there any way you
> can convert array dimensions into cell ranges automatically, I would be
> grateful for any advice.
>
> Regards,
> Martin.
0 Kudos
Message 2 of 3
(3,463 Views)
Look in the LabView ActiveX Example  "Write Table To XL.vi" for the sub-function that they created to convert a numeric position into the Excel column/row format.  It's called "Row Col To Range Format.vi".  It will properly handle the jump from column 26 = 'Z' to column 27 = 'AA'.  Then you can use the array length function to calculate the starting and ending ranges as X and Y integers.--Michael Munroe    Mailto:mmunroe@abcdefirm.comA Better Complete Development Engineering FirmSan Mateo, CA  94403  http://www.abcdefirm.comMartin Stanley wrote:Hi,    I am sending data to excel using the invoke node with worksheet andrange methods present.  This allows me to dump a whole array into excelproviding I input the range of cells which I want the data to be sent toi.e. A1
:J4.  The problem I have is that I want to be able to read invariable size arrays and dump these to excel at the press of a Booleanwithout having to enter the cell ranges all the time.  Is there any way youcan convert array dimensions into cell ranges automatically, I would begrateful for any advice.Regards,    Martin.  
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 3 of 3
(3,463 Views)