cancel
Showing results for 
Search instead for 
Did you mean: 

Blue Prism Excel VBO Get Worksheet Only Visible?

AtliHarðarson
Level 4

Hi,

Can the template Get Worksheet As Collection be altered so it only gets visible data?

	Dim ws as Object = _
	 GetWorksheet(handle, workbookname, worksheetname, False)

	' Do we have a sheet?
	sheetexists = ws IsNot Nothing
	' No sheet? No entry.
	If Not sheetexists Then Return

	ws.Activate()

	worksheetCollection = GetWorksheetUsedRangeAsDataTable(ws.UsedRange, True)

Since my collection is too large I'm applying an AutoFilter using this:

Dim worksheet as Object
Worksheet = GetWorkbook(handle, Nothing).ActiveSheet
worksheet.UsedRange.AutoFilter (Field:= FieldToBeFiltered, Criteria1 := criteriaToFilter)

But I'm having a hard time extracting this data without the VBO trying to get the whole sheet which breaks the memory.

Best Regards
Atli

1 BEST ANSWER

Best Answers

Hi Atli,

Use  "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells

Thanks
Nilesh
Nilesh Jadhav.
Consultant
ADP,India

View answer in original post

1 REPLY 1

Hi Atli,

Use  "Ws.Cells.SpecialCells(xlCellTypeVisible)" it will give you only visible cells

Thanks
Nilesh
Nilesh Jadhav.
Consultant
ADP,India