Very Hidden worksheets

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,404
My workbook, called Protectedwb, contains a number of very hidden worksheets.

This workbook also has a password to protect the VBA code.

I want to prevent users from unhiding all the worksheets.

Despite not knowing the names of the very hidden worksheets (because the code is password protected), it seems it is still possible to unhide those worksheets, as follows:

1. Open Protectedwb
2. Open a new workbook

Add this code to the new workbook:

Code:
Dim wb As Workbook
Set wb = Workbooks("Protectedwb.xlsm")

Dim ws As Worksheet

For Each ws in wb.Worksheets

    ws.Visible = xlVisible

Next ws

Is there a more secure way to prevent this?
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
6,479
Office Version
  1. 2019
Platform
  1. Windows
Hi,
Try protecting the Workbook structure & see if this resolves your issue


Dave
 
Solution

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,404
T
Hi,
Try protecting the Workbook structure & see if this resolves your issue


Dave
Thanks, that did the trick!
 

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
6,479
Office Version
  1. 2019
Platform
  1. Windows
welcome - glad resolved your issue

Dave
 

Watch MrExcel Video

Forum statistics

Threads
1,127,308
Messages
5,623,895
Members
415,999
Latest member
Sovereign maphoso

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