Search code examples
vbscriptautomationanywhere

What is the proper syntax when calling VBScript via Automation Anywhere Run Script command?


I have this VBScript for scrolling vertically / down a webpage, but when I execute the script, I get the following error: Error in Script - 1044 Cannot use parentheses when calling a Sub

Here is the script syntax:

Function scrollWin() 
  window.scrollBy(0, 100)
End Function

Note. I'm using the Automation Anywhere "Run Script" command to execute the vb-script. Could I get some guidance as to what I'm doing wrong?


Solution

  • Change this line:

    window.scrollBy(0, 100)
    

    To:

    window.scrollBy 0, 100