Protecting My Macros


Posted by Gene Tran on November 08, 2001 11:54 AM

Is there anyway that i can put a password on my macros so that people can't view them or get to them. I don't want anyone to make any changes to my macros.



Posted by Tom Urtis on November 08, 2001 12:02 PM

Protect your modules by going into the Visual Basic Editor, then select your workbook project in the Project Window, and click on Tools > VBA Project Properties. Click the Protection tab, select Lock project for viewing, enter & reconfirm your password and click OK. The next time you open the workbook the modules will be unview-able.

By the way, this does NOT stop a user from running a macro, it only stops them from seeing the code. Prefacing the macro with an input box to require a password to execute the macro is a good idea if the macro should only be run under certain circumstances.

Tom Urtis