cancel
Showing results for 
Search instead for 
Did you mean: 

Excel VBO - Transferring VBA from Excel into Blue Prism

Anonymous
Not applicable
I am trying to write an excel filter action. Here is what I have in Blue Prism: Dim wb, ws as Object Dim excel, sheet, range As Object wb = GetWorkbook(Handle, Workbookname) ws = GetWorksheet(Handle, Workbookname, Worksheetname) wb.Activate() ws.Activate() excel = ws.Application sheet = excel.ActiveSheet range = sheet.Range(DataRange) ws.range.Autofilter (Field:=[field1], Criteria1:=[criteria1], _ Operator:=[operator1], Criteria2:=[criteria2])   Original filter code in VBA: 'ActiveSheet.Range("$A$4:$U$1747").AutoFilter Field:=8, 'Criteria1:="=*Spl*", Operator:=xlAnd, Criteria2:="=*Harbor" I received the following error: Number of parameters specified does not match the expected number. Please advise what has to be adjusted. Can a method in VBA have more than 2 parameters? Could that be an issue?
1 REPLY 1

BordessoullesVi
Level 3
Dim wb, ws As Object Dim excel, sheet As Object     wb = GetWorkbook(handle, workbookname)     ws = GetWorksheet(handle, workbookname, worksheetname)     wb.Activate()     ws.Activate()     excel = ws.Application     sheet = excel.ActiveSheet if (inputCriteria1 = """") then     sheet.Range(InputRange).AutoFilter(Field:=[inputField],VisibleDropDown:=[inputVisibleDropDown]) else if (inputOperator 0) then     sheet.Range(InputRange).AutoFilter(Field:=[inputField],Criteria1:=[inputCriteria1],Operator:=[inputOperator],Criteria2:=[inputCriteria2],VisibleDropDown:=[inputVisibleDropDown]) else     sheet.Range(InputRange).AutoFilter(Field:=[inputField],Criteria1:=[inputCriteria1],VisibleDropDown:=[inputVisibleDropDown]) end if