PDA

View Full Version : How to hide macros or VBA codes



joelle
04-05-2006, 11:22 AM
Hello Experts,

Most of us know Alt+F11 will display the macro / vba project windows, and so protecting a sheet with a password doesnt work quite well then.

Pls how do I I hide my macros or vba codes?

Thanks a lot,
Nee

lucas
04-05-2006, 11:50 AM
Hi Nee,
you can protect you vba project in the vbe with a password. After using Alt+F11 to get to the vbe just click on the file name in the project explorer window on the left side.

Look there for vbaproject (book1) where book1 is the name of the file. you can right click on any of the objects, sheets, modules etc and look for the line that says vba project properties.

There are two tabs on the dialog box. Click on the protection tab and check the box that says lock project for viewing and then add your password below.

bear in mind that this is minimal protection but it will keep out most average users.

lucas
04-05-2006, 11:51 AM
ps don't forget your password or make a copy to distribute that is password protected...

Desert Piranha
04-05-2006, 11:58 AM
Hello Experts,

Most of us know Alt+F11 will display the macro / vba project windows, and so protecting a sheet with a password doesnt work quite well then.

Pls how do I I hide my macros or vba codes?

Thanks a lot,
NeeHi Nee,
And to hide from the Tools>Macro> list put this at the top of your module:
Option Private Module

joelle
04-05-2006, 12:16 PM
Hello Lucas and Dave,
Very fast turnaround -- Thanks a bunch for the quick tip; it works. :)

Best regards,
Nee