How do I lock VBA?

  • Thread starter Thread starter ckerns
  • Start date Start date
C

ckerns

After wb and sheets are protect Alt-F11 will still open my VBA window.
Is there a way to stop this from happening?

tia

jp
 
You are probably best off to just protect the project. In the VBE in the
Project Explorer -> right Click on the Project -> Select Properties -> Select
Protection -> Check Lock Project for Viewing and add a Password.
 
Why should Excel do this? If you have a second, not protected workbook open,
would you still want Excel to block access to the VBA editor? Makes no sense
to me.

If you want to prevent your users from viewing your code, password protect
your VBA code.
If you want to prevent the use of Alt-F11, you can use an OnKey method (e.g.
in your Auto_open macro) to reassign this key combination to something else
(or nothing at all). But be aware that user can still access the VBA editor
via the menu.

Cheers,

Joerg
 
Back
Top