Protect VBA

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
VBA code can be protected with a password (although it can be hacked using third party software).

Regardless, adding a password does NOT prevent access to the vb editor.

My workbook contains very hidden worksheets, so the only way to unhide them is using code.

But even if the code is password protected, users can still open the vb editor, open the immediate window and unhide worksheets using:

Code:
myhiddensheet.Visible = xlSheetVisible

Is there any way to prevent users from doing this?

I came across code to stop users opening the vb editor but to get round that, all they needed to do is disable macros (which disables the workbook_open event) and then open the vb editor.

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
What about Excel DNA?

Does that require .Net knowledge?
 
Upvote 0
If you're willing to pay for other tools, you could try Unviewable+
 
Upvote 0
Have you thought about password protecting the workbook structure via Revision>Protect Workbook ?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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