worksheet protection as a encrypted password

witamserdecznie

New Member
Joined
Jun 12, 2010
Messages
34
Hi,

I have seen that in one spreadsheet a worksheet password in VBA looked like: Const password = "é]CÔŢ~áü$đŚ¸»łË=‚XTŁµĂš`;픟‘¨ěۆČFFĚö4żą0"

And yet when it came to: ThisWorkbook.ActiveSheet.UnProtect Password:=password it worked perfectly fine.

However when I type in this password in the review -> unprotect sheet then it does not work.

How to make a password show in VBA in an encrypted way as shown above? Say in the VBA it looks like "é]CÔŢ~áü$đŚ¸" but in the unprotect popup window you type in "secretpassword" and the sheet is unlocked?

Thanks.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi,

I have seen that in one spreadsheet a worksheet password in VBA looked like: Const password = "é]CÔŢ~áü$đŚ¸»łË=‚XTŁµĂš`;픟‘¨ěۆČFFĚö4żą0"

And yet when it came to: ThisWorkbook.ActiveSheet.UnProtect Password:=password it worked perfectly fine.

However when I type in this password in the review -> unprotect sheet then it does not work.

How to make a password show in VBA in an encrypted way as shown above? Say in the VBA it looks like "é]CÔŢ~áü$đŚ¸" but in the unprotect popup window you type in "secretpassword" and the sheet is unlocked?

Thanks.

If I understand right, you don't want the user to see the sheet password in the VBE window . If so, cant' you password protect your vb project to prevent the user from seeing the sheet password along with the rest of any code you may have ?

Edit: I tried the above encrypted password in excel 2007 and worked fine.
 
Last edited:
Upvote 0
I tried it several times and it does not work on my machine. It does work when protected and then unprotected through VBA but not through the 2007 ribon. I will try to test it on another machine - maybe then...
 
Upvote 0

Forum statistics

Threads
1,221,572
Messages
6,160,575
Members
451,656
Latest member
SBulinski1975

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