Arguments not legal in declaration of: <sub name>

The following conditions could have caused this error:

  • You specified parameters in a Sub Initialize or Sub Terminate definition. Because the Initialize and Terminate subs are executed automatically on module load and unload, they cannot be passed arguments.

    Redefine the sub without parameters.

  • You specified parameters in a Sub Delete definition. Because the Delete sub is executed automatically when an object reference is deleted, it cannot be passed arguments.

    Redefine the sub without parameters.