LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to add to exisiting excel spreadsheet with property nodes and method nodes.

I am trying to append a new row of data to an existing worksheet everytime my program executes.  I am using property node "worksheet: range" in conjunction with invoke node "range: value"  Will the method know to go to the next empty row when it is a pre-exisiting worksheet?  If not, should i use something like a shift register to increment the cell ranges?
0 Kudos
Message 1 of 4
(2,774 Views)
The inputs to "worksheet:range" and "range:value" tells Excel what the data value is and where to place it in the active worksheet.

The Excel Help files has further explanations.
0 Kudos
Message 2 of 4
(2,768 Views)
I understand how to use range and range: value in labview.  but is there anyway i can figure out which cells are populated with data and then add to the end of that range? 
0 Kudos
Message 3 of 4
(2,757 Views)
I always recommend first implementing what you want in Excel as a macro (You can record a macro from the worksheet) to see what commands you need, and how the object structure for it is organised.

You can use the command ".end(xldown)" to jump to the end of a column.  By doing this and then getting the current address, you can work out where the data ends.  The function can be used as activeworkbook.range(whatever).end.(xldown)".

The only annoying thing is that you have to find the numeric representation of "xldown".  It's -4121 by the way.  You can search the VBasic help within excel for this.

    ActiveSheet.Range("A1").Select
    MsgBox (Selection.End(xlDown).Address)

The above little macro will give a text message with the address of the last non-empty cell in the A column (Asuuming A1 isn't empty, in which case it'll give the very bottom cell in the row A).

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 4
(2,744 Views)