Invalid procedure name error

You have either specified an invalid procedure name or did not include a procedure name when you attempted to create the procedure.

Valid macro names:

  • Must begin with a letter.

  • Cannot contain spaces or non-alphanumeric characters (ampersand (&), asterisk (*), slash (/), and so on).

  • Cannot contain periods. You may use a period (.) in a macro name only to explicitly define a procedure within a module. For example, if you type in the new macro name "my.test", you have created a new Module called "my" containing a Procedure named "test".

  • Cannot exceed 80 characters.

  • Cannot conflict with the reserved identifiers or keywords for a program, such as the word "print".

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.