VBA – Excel – Lock macros from viewing

With this short article I will briefly explain how to protect your VBA code from viewing from 3rd parties.

It is as simple as that:

1. Open the Visual Basic Editor.

2. On Tools select “VBA Project Properties.

LockMacrosFromViewing

 

3. Select the protection tab.

LockMacrosFromViewing2

 

4. On the protection tab simply write a password (No password restrictions, even a 2-sign password is valid) and click OK.

5. You may close the file now.

6. When you open it again and you try to enter VBA you get an input box for password:

LockMacrosFromViewing3

 

7. Congratulations! Now your macros are now protected!