-1

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?

user1724708
  • 1,409
  • 7
  • 31
  • 53
  • 1
    Does this answer your question? [Cannot use parentheses when calling a Sub Error 800A0414 VBS](https://stackoverflow.com/questions/14902134/cannot-use-parentheses-when-calling-a-sub-error-800a0414-vbs) – user692942 Jul 26 '21 at 15:56
  • For reference (seen as though you have already accepted a duplicate answer), if you looked at the duplicate target you would know you could also just prefix with `Call` to still use parentheses, like this; `Call window.scrollBy(0, 100)`. – user692942 Jul 26 '21 at 17:22

1 Answers1

0

Change this line:

window.scrollBy(0, 100)

To:

window.scrollBy 0, 100
LesFerch
  • 1,540
  • 2
  • 5
  • 21
  • [This isn’t a new question](https://stackoverflow.com/a/14908329/692942) (answered over 8 years ago), flag and move on. All answering does is dilute existing canonical questions and answers. Plus your answer doesn’t mention the use of `Call` to allow you to still call a `Sub` with parentheses. – user692942 Jul 26 '21 at 15:57