Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Only comments, directives, and declarations are permitted outsideprocedures. This error has the following cause and solution:
- You placed executable code outside a procedure. Any nondeclarative lines outside a procedure must begin with a comment delimiter ('). Declarative statements must appear before the first procedure declaration. Comments are ignored when the code executes.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
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.