Prevent VBE from opening

Whisperer14

Well-known Member
Joined
Nov 6, 2002
Messages
589
I am aware that password *******s can render the password protection of VBA code ineffective.

The only way that I can think of getting around the problem is to prevent the VBE opening from either the Alt+F11 or the 'View Code' options.

Any idea would be most welcome, even if it is a 'No, it cannot be done' in which case I shall have to learn VB or Delphi :biggrin:.
(y)
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
There is no foolproof way to do it. This code will disable most options, but the right click on the worksheets tabs allows you to still enter the VBE. Of course the user has to press the enable macro's option to let the code run.


Application.CommandBars("Visual BaSIC").Enabled = False
Application.CommandBars.DisableCustomize = True
Application.OnKey "%{F11}", ""
 
Upvote 0
Thanks Cbrine, I have used just the last of the 3 options, setting Fll to "", how do I restore it to open the VBE please?
 
Upvote 0
Well, for the part you need to send a cheque. :biggrin:

Just kidding.

Application.OnKey "%{F11}"

Cal
 
Upvote 0
Dave,

What a nightmare situation!

Thank you for the link, your solution was very interesting but it begs a question. If the master file is closed then the safeguards are negated, is there a way of ensuring that it is not visible in the Taskbar and automatically closed when the opened program is closed?
TIA
Gordon (y)
 
Upvote 0
At the risk of being censored again, I will provide some suggestions and not evil code. Assuming that the "master" file is your actual program that you want protected, if you make the calling program an addin on workbook closed and the "master" program not an addin on workbook open, the result is that only the "master" program will be in the taskbar and you will not have access to the VBA editor. Sorry I can't be more specific. Hope this helps. Dave
 
Upvote 0

Forum statistics

Threads
1,214,804
Messages
6,121,652
Members
449,045
Latest member
Marcus05

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