Password Workbook Protection in Macros

Andy Pilkington

Board Regular
Joined
Jan 23, 2014
Messages
87
Office Version
  1. 365
Platform
  1. Windows
Hi,

I want to be able to protect and unprotect workbooks with a password using macros so that the casual user cannot unhide or hide worksheets without the password. The aim is that only worksheets unhidden by macro control should be available to the user.

Is this possible?

Thanks,
AP
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
This is one way.
But, Excel is not secure. I see too many (IMO) people on this site fuss and fiddle with Excel security options that are, ultimatly, not secure.
Making it hard for friendly users to make an error is one thing, bu keeping bad actors out is not what Excel does. On Excel, one should spend a minimum of one's time on access control.
 
Upvote 0
Thanks for this Mike. I accept that clever Excel users will be able to break the code but I just want enough to put the casual curious user off.

Thanks,
AP
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

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