How to Hide Excel VBA Code Using Password

A website visitor wants to know how he can prevent people from seeing his VBA code in Microsoft Excel.
We know how to hide formulas, lock worksheet cells and protect a worksheet from our earlier videos.
The process of hiding the macro code is quite simple as shown in the training video:

In the Visual basic for Applications window click on ‘Tools’

  1. Click on ‘VBA Project Properties’
  2. Select the ‘Protection’ tab
  3. Select the check-box for ‘Lock project for viewing’
  4. Enter your password. Ensure it’s a strong password using lower- and upper case characters, numbers and special characters like commas, +, etc.
  5. Re-enter the password to confirm
  6. Finally click on OK

Now the VBA code is hidden when you save the file and re-open it.

Watch the video below to see how the complete process is implemented quickly and easily:

2 thoughts on “How to Hide Excel VBA Code Using Password

  1. I kept two sheets in one excel file 1. Entry sheet & 2. Data base sheet . i want to keep the data base sheet in hidden mode for the data entry operator. I wonder if you please advice me how i can code in VBA to transfer input from the entry sheet to the database without unveiling the hidden sheet. i saw and tested your codes which works excellent if both sheets are visible. thanks for your time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.