Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (5.3k 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

 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...