How can I password protect my code?

Badnames

Board Regular
Joined
Jun 12, 2007
Messages
211
One of the workbooks I inherited prompts for a password when someone right clicks on a tab and clicks view code. I'd like to have this happen in another workbook. Does anyone know how I can protect the code?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Open the VB editor, go to Tools>VBA ProjectProperties>Protection. Tick Lock Project for viewing and enter a password. Then save and close your workbook.
 
Upvote 0
Right Click the Module, Select VBAProjecProperty, then Protection TAB give Password and Check that Box that's it!!!
 
Upvote 0
This did not work. I am running excel 2007. I went into view code --> tools --> VBA project properties --> protection checked the box to "Lock project for viewing" and then typed in a password. Saved my file, reopened the tools menu and confirmed that the password was there and the toolbox is checked. Saved my file again and closed out. When I reopen the file the password did not work and I am able to access the code portion. I check under tools and see that the password is blank and the toolbox is unchecked. Any idea why this may be happening?
 
Upvote 0
This did not work. I am running excel 2007. I went into view code --> tools --> VBA project properties --> protection checked the box to "Lock project for viewing" and then typed in a password. Saved my file, reopened the tools menu and confirmed that the password was there and the toolbox is checked. Saved my file again and closed out. When I reopen the file the password did not work and I am able to access the code portion. I check under tools and see that the password is blank and the toolbox is unchecked. Any idea why this may be happening?

So have you forgot the password or what????

I hope you have added your password in both the fields i.e, Password and Confirm Password
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top