I need to put a password for a VBA code

gaftalik

Well-known Member
Joined
Feb 6, 2003
Messages
521
Office Version
  1. 2016
Platform
  1. Windows
Hi ,
How can i put a password for a module to be opened?

Many Thanks !
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
That's very true , Thank you !

And thank you all for the contribution.
 
Upvote 0
Hi, I've got the same issue, box ticked, saved and closed but it doesn't work ? I've got it to work on a xlsm file, but when trying to do it on a xlsx it wont remember passwords. Does anyone know if certain files wont work, or which files will except xlsm's ? When i email files i dont want to use xlsm as this might scare customers.

Thanks for your inputs
 
Upvote 0
Why do you want to protect the VBA modules in an XLSX file?
 
Upvote 0
It will not work (2007 onwards) in a file that doesn't actually contain code. So you can no longer for example set a worksheet to veryhidden and then protect the project. There has to be code (or vbcomponents).
 
Upvote 0
Thanks Ruddles & Rorya
I did wonder if it was a format issue, but as i didn't have to manually add any code to the xlsm file to protect it i presumed it should (in theory) be able to password protect any MS file.

The reason to protect the file was to "Very Hide" some sheets and lock them as they have confidential info in them.

Thanks again
Ant
 
Upvote 0

Forum statistics

Threads
1,223,445
Messages
6,172,177
Members
452,446
Latest member
walkman99

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