Calling Sub Procedures

There are two ways to call a Sub procedure:


' Both of these statements call a Sub named MyProc.
Call MyProc (firstArgument, secondArgument)
MyProc firstArgument, secondArgument

Note that when you use the Call syntax, arguments must be enclosed in parentheses. If you omit the Call keyword, you must also omit the parentheses around the arguments. For more information about arguments, see "Communicating with Procedures Using Arguments" later in this chapter.

Unlike a Function procedure, a Sub procedure cannot be called by using its name within an expression, and it doesn't return a value.