Very Hidden worksheets

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,825
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
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?
 

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
Hi,
Try protecting the Workbook structure & see if this resolves your issue


Dave
 
Upvote 0
Solution
T
Hi,
Try protecting the Workbook structure & see if this resolves your issue


Dave
Thanks, that did the trick!
 
Upvote 0
welcome - glad resolved your issue

Dave
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,255
Members
448,556
Latest member
peterhess2002

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