How to Remove Ability to Disable Macros?

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hello, I have a workbook that has a login form that gives users viewing rights to particular sheets with the use of macros. These "hidden" sheets should not be able to be viewed by someone unless they have access rights to that particular sheet. Macros MUST be enabled to run the workbook correctly and if someone were to disable the macros, all of the "hidden" sheets could be found.

I want to prevent a user from being able to disable macros in my workbook.

How do I do this for anyone other than me (the admin)?

Thanks

Brett
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Of course, there are always ways around this since Excel isn't a super secure app, but a few things I do with mine to keep most people out, include the following"
- Setting the sheets to very hidden rather than hidden
This includes ALL sheets....so essentially if the user disables macros and is unable to login then there is nothing for them to see.
- Create a macro that sets applicable sheets to very hidden prior to closing the app
- Create another than sets applicable sheets to very hidden upon opening the app
- Password protect your VB Project
- Create macro to prevent 'save as' for anyone except an admin
- Use a password to open the app - encrypted.
 
Upvote 0
Of course, there are always ways around this since Excel isn't a super secure app, but a few things I do with mine to keep most people out, include the following"
- Setting the sheets to very hidden rather than hidden
This includes ALL sheets....so essentially if the user disables macros and is unable to login then there is nothing for them to see.
- Create a macro that sets applicable sheets to very hidden prior to closing the app
- Create another than sets applicable sheets to very hidden upon opening the app
- Password protect your VB Project
- Create macro to prevent 'save as' for anyone except an admin
- Use a password to open the app - encrypted.
I like this solution to the problem. I was about to comment explaining that although sometimes I would like the ability to force macro-enable or prevent turning it off, I understand how horribly destructive it could be to create a malicious macro and prevent turning off macros. But this solution takes the opposite approach, incentivizing having macros enabled and having the correct security access.
 
Upvote 0
The ability to enable or disable macros is a security feature to give users option to trust code contained in a workbook – if that feature could be disabled by code, it would rather defeat its purpose.

There are many published methods you could consider that may “encourage” your users to enable macros

Have look here: Ensure Macros Are Enabled

and see if any help to you

Dave
 
Upvote 0
Is it important to note (and a good thing) that you CANNOT force people to enable macros.
If that was possible, hackers could "force" viruses on your computer!

But as you can see, there are way to render the workbook practically useless (to a certain extent) unless they do enable them.
 
Upvote 0
If anyone is interested, I've linked my current project here:
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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