Illegal use of parentheses

You called a sub or function and enclosed its argument list in parentheses. You can only do this under the following circumstances:

  • The sub or function is the target of a Call statement. For example:
    Call MySub()                         ' Legal
    Call MyOtherSub("ABC", 4)            ' Legal
    Call MyFunction()                    ' Legal
    Call MyOtherFunction(123, "XXX")     ' Legal
  • The sub or function has a single parameter that the caller is passing by value. For example:
    MySub("ABC")                     ' Legal
    MyFunction(anInt%)               ' Legal
  • The target is a function that is included in a statement. For example:
    X% = MyFunction(123, "XXX")      ' Legal

The following are illegal:

MySub()                          ' Illegal
MyFunction()                     ' Illegal
MyOtherSub("ABC", 4)             ' Illegal
MyOtherFunction(123, "XXX")      ' Illegal

Remove the parentheses from around the argument list or call the sub or function with the Call statement.