27-11-19 01:21 PM
Dim worksheet as Object Worksheet = GetWorkbook(handle, Nothing). ActiveSheet worksheet.UsedRange.AutoFilter (Field:= fieldToBeFiltered, Criteria1:= criteriaToFilter)
27-11-19 01:43 PM
28-11-19 08:30 AM
Hi,
Assuming, you tried to build the custom object from scratch. You might have forgot to add the function definition in your global code/ custom code for GetWorkBook.
Here is the code for your reference.
Protected Function GetWorkbook(Handle As Integer, Name as String) As Object Dim wb as Object = Nothing If String.IsNullOrEmpty(Name) Then wb = GetInstance(Handle).ActiveWorkbook If wb Is Nothing ' We need to create a deafult workbook wb = NewWorkbook(Handle) End If Return wb Else Return GetInstance(Handle).Workbooks(Name) End If End Function
Use it inside your code and then it should work.
03-12-19 09:55 AM
Dim worksheet as Object Worksheet = GetWorkbook(handle, Nothing). ActiveSheet worksheet.UsedRange.AutoFilter (Field:= fieldToBeFiltered, Criteria1:=criteriaToFilter, Operator:=2, Criteria2:="=")
However when running the process showing Excel output, only the "Blank" cells are being selected to be filtered: