PDA

View Full Version : [SOLVED] Disable Macros



gibbo1715
02-12-2005, 02:23 AM
Dont know if this exists so just checking

I have a userform running and have hidden excel behind it and password protected my code

I have also coded the userform so when unloaded it closes the workbook and hides (xlVeryHidden) the worksheets protecting my data.( so done all the security stuff as best I can within excel i think). Work book is also password protected ( well excel passwords anyway)

What i want to know is is there a short cut available to my users that will stop the VBA running and close the userform without running the close macro attached to it, giving access to the worksheets that would normally be hidden

And if so can I de activate the short cut?

I know this can be done using another workbook anyway but thats not an issue for me

Jacob Hilderbrand
02-12-2005, 02:53 AM
Users can stop a macro by pressing Esc or Ctrl+Break. You can stop this by adding the following line to the start of your macro.

Application.EnableCancelKey = xlDisabled
Just know that the user will have no way to stop a macro except by ending the Excel task (and losing any saved info). so make sure that you check any loops to make sure that they won't run forever under certain circumstances.

gibbo1715
02-12-2005, 05:18 AM
thanks Jake