VBA Very hidden worksheet password function not working

Connection78

New Member
Joined
Jul 14, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
It's been a while since I used VBA's in Excel to get a worksheet to be very hidden and password protected. Last time I was able to do it at my previous employer on my work computer. Now I'm trying to do it on my personal computer.

So here is my case. I want to hide a particular worksheet and when I open VBE I am able to change the visible status of the worksheet to very hidden, no problem with this step. I then open the VBAProject - Project Properties dialogue box and under the protection tab I type in my password and tick the 'lock project for viewing' box and then press OK and close the dialogue box. And as expected this worksheet is now hidden. However, here is the problem. When I go back and change the visible status back to visible, I get my worksheet to show up but it does not require me to type in a password.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,847
Office Version
  1. 2019
  2. 2016
  3. 2010
Platform
  1. Windows
Hi,
You need to save workbook and reload it.
 

AC PORTA VIA

Board Regular
Joined
Apr 9, 2016
Messages
132
Office Version
  1. 365
Platform
  1. Windows
After you make sheet hide and vba project protected you need to save it
 

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,847
Office Version
  1. 2019
  2. 2016
  3. 2010
Platform
  1. Windows

ADVERTISEMENT

Hm, try changing your password, there seems to be one that doesn't work.
Questions:
1. Is there any code in VBA modules?
2. Whether a password is requested when trying to view the code?
 

Connection78

New Member
Joined
Jul 14, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Hm, try changing your password, there seems to be one that doesn't work.
Questions:
1. Is there any code in VBA modules?
2. Whether a password is requested when trying to view the code?
Thanks for the reply,

There's no other VBA code in my file.
 

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,847
Office Version
  1. 2019
  2. 2016
  3. 2010
Platform
  1. Windows
Any code is required, just add something like this, save workbook into XLSB or XLSM format and reopen it:
VBA Code:
Private Sub Dummy()
End Sub
 

Forum statistics

Threads
1,148,008
Messages
5,744,324
Members
423,862
Latest member
ExcelUserX

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
Top