Consulting

Results 1 to 3 of 3

Thread: Disable Macros

  1. #1
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location

    Disable Macros

    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

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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.

  3. #3
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    thanks Jake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •