Question

I am looking for a possibility to add an additional level of security to my Excel projects.

We have multiple users. Some who know (and are meant to) the password that unlocks the VBA macros. Others are not meant to be able to access these.

I'm not sure if someone has the password that shouldn't (changing the password hasn't stopped tampering) so i would like to disable the VBA editing window for any user not approved. I can't find any way to do this though, is it possible?

I can't disable the save option as all users need to save data.

I have tried to disable the ribbon icons etc, but with no sucess. It is still possible to open the code window with Alt+F11.

Any help would be great.

Was it helpful?

Solution

I am coming from Excel 2003, but this concept should work for you as well. You could think of

  • trapping the Alt-F11 key (Application.OnKey "%{F11}" "MyNullSub") plus
  • disable the relevant menu entries (Application.CommandBars(...).FindControl(ID:=..).OnAction = "MyNullSub")

with

Sub MyNullSub()
' do nothing
End Sub

as a dependency of an entry in the registry that needs to be present (GetSetting(...)), but this will only help until this additional secret is spread around in the same way the (changed) passwords apparently did.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top