To prevent someone from viewing or making changes to your Microsoft Visual Basic for Applications (VBA) code, you can protect the code by requiring a password.
Tip
You can also press ALT+F11.
Guidelines for passwords
User names can range from 1 to 20 characters, and can include alphabetic characters, accented characters, numbers, spaces, and symbols, with the following exceptions:
- The characters " \ [ ] : | < > + = ; , . ? *
- Leading spaces
- Control characters (ASCII 10 through ASCII 31)
Note Passwords are case-sensitive.
The password is now set. The next time you or any other user opens the database, a dialog box will be displayed that requests a password.
Important If you forget your password, it can't be recovered, and you won't be able to view or edit the VBA code.