19-01-24 04:29 PM
22-01-24 02:06 PM
This is the infamous action with the Blue Prism description "Actually, I've no idea whatsoever what this does."
We recently noticed this action was not always returning the correct value, and replaced the code with the following:
Dim row1 as Long, row2 as Long
row1 = GetWorksheet(handle,workbookname,worksheetname).Cells.Find("*", , , , , 2).Row
row2 = GetWorksheet(handle,workbookname,worksheetname).Cells.Find("*", , , , , 1).Row
If row1 >= row2 Then
rowcount = row1
Else
rowcount = row2
End If
Now it executes a .Find by columns, then again by rows, and returns the highest row number found. It's giving the correct last row used value now.
Hope this helps,
Hutch
23-01-24 08:16 PM
To get a count of the used rows, try this:
rowcount = GetWorksheet(handle,workbookname,worksheetname).UsedRange.Rows.Count
Cheers,