0 votes
1 view
in RPA by (5.4k points)

Hello, I am trying to upload VBScript to filter out only data that has been changed. When I am using script as a Macro it works but when I am launching it via AAE it throws an error:

Sub filtering() Range("H3").AutoFilter Field:=8, Criteria1:="<>" Range("Q3").AutoFilter Field:=17, Criteria1:="<>" Range("P3").AutoFilter Field:=16, Criteria1:=">=" & Range("A1").Value Operator:=xlAND Criteria2:="<=" & Range("A2").Value End Sub

1 Answer

0 votes
by (9.5k points)

We should use the subroutine inside the script tag

<script type="text/vbscript"> Sub filtering() Range("H3").AutoFilter Field:=8, Criteria1:="<>" Range("Q3").AutoFilter Field:=17, Criteria1:="<>" Range("P3").AutoFilter Field:=16, Criteria1:=">=" & Range("A1").Value Operator:=xlAND Criteria2:="<=" & Range("A2").Value End Sub </script>

Or ignore the Subroutines entirely and include the below snippet in the .vbs file in AAE

Range("H3").AutoFilter Field:=8, Criteria1:="<>" Range("Q3").AutoFilter Field:=17, Criteria1:="<>" Range("P3").AutoFilter Field:=16, Criteria1:=">=" & Range("A1").Value Operator:=xlAND Criteria2:="<=" & Range("A2").Value

 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...