Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have an excel with macros when users tries to access the code behind the excel by clicking ALT + F11 then the excel should close it self.

What I have tried:

Tried recording macro did not worked
Posted
Updated 19-Jan-17 22:59pm

1 solution

Quote:
I have an excel with macros when users tries to access the code behind the excel by clicking ALT + F11 then the excel should close it self.

This is a bad solution to another problem. User can have legitimate reasons to go to developer mode.
If you want to protect you macros from user eyes, just use the standard protection with a password.

If the user opens the macro editor before your macro is loaded, and you are done.
A developer can also build a macro that open the macro editor without using ALT + F11, and you are done.

To protect macros, from the macro editor, use Tool menu and protect the project with a password.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900