无效程序名称错误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. 例如,如果在新的宏名称中键入“my.test”,则你已创建包含程序名为“test”的“my”新模块。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".

  • 不能超过 80 个字符。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

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.