Excel Object Failing with 64 bit Office
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-01-24 04:29 PM
------------------------------
Shannon Berlin
Business Process Specialist
Chesapeake Energy
America/Chicago
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
------------------------------
Thomas Hutchins
Lead Developer
Discover
America/Chicago
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
