LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmaticaly Get Next Cell Index of Excel Sheet

Hi Joe,

What I am trying to do is decypher Michael notation.

For the time being (and probably permanently Smiley Mad ) I will write a field to the sheet that records the last row that has data. I can read that fast enough.

What I am trying to do is open an arbitrary spreadsheet and figure out where (which row) the next line of log file that should be updated.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 11 of 17
(4,743 Views)
Regarding the COUNT method, it's only useful if you know that your data is from row 1 to n without any breaks.  Otherwise using it this way can give you the wrong address to write to.

Glad I could help,

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

When appending data to an existing Excel file, here are three VIs I use to find where the current block of data ends.  Both the End(xlDown) and UsedRange options can return the location of the last row, but the UsedRange does not need a starting point and will ignore blank cells.  The Get Next Available Row.vi is the implementation of the VBA code that I described earlier in this post.

Excel Tip:  If you look at the diagram of my Get Next Available Row.vi, you will see how it is possible to eliminate the use of the conversion from row and column index to A1 notation.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 13 of 17
(4,662 Views)

I love it.

Thanks Mike




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 14 of 17
(4,646 Views)

Thank you Michael!

The project I needed that for shipped two months ago but I am sure I will be asked this again.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 17
(4,642 Views)

Hi all,

 

This is an oldish thread but perhaps someone may pick up on it. The code looks like it calls out what it is referring to as Worksheets. Is this the separate sheets within an Excel Workbook or when you say Worksheets, do you mean the entire Workbook?

 

 

0 Kudos
Message 16 of 17
(2,517 Views)

That means the worksheet within the workbook.

0 Kudos
Message 17 of 17
(2,512 Views)