Results 1 to 6 of 6

Thread: [RESOLVED] Trap Unprotect Event

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Resolved [RESOLVED] Trap Unprotect Event

    Is there any way to trap an event in which a user unprotects a sheet or workbook so that I can force some addtional requirements (like user-id). Or, is there a way to disable the 'Unprotect' menu command (so that I can create my own QAT button to do unprotects)? I do not want to simply protect a sheet or workbook with a password. I want to add additional requirements before a user can unprotect something and also log the user and time that this action was performed. Thanks.

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Trap Unprotect Event

    I could be wrong but there is no way to trap the user unprotecting/protecting the sheet. You can however disable the option by protecting the workbook...

    Similarly there is no way to trap the user unprotecting/protecting the workbook
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Trap Unprotect Event

    Protecting the workbook to disable the option to unprotect any sheet would be okay, but I can't get it to work. I protect the workbook, but after that, I can still protect / unprotect any sheet. What am I missing? Thanks.

  4. #4
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Trap Unprotect Event

    "Protect Workbook" will not allow you to add, move, delete, hide/unhide sheets but it has no effect on protect/unprotect sheets.

    "Protect Shared Workbook" will disable all other Protect/Unprotect options for sheet/workbook. That also locks the VBA project.

    Shared workbook will have some side effect if you don't mind. You also can set "Don't keep change history" to True (default is to keep for 30 days).
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Trap Unprotect Event

    Thanks. Looks like Protect Shared Workbook also prevents me from creating my own 'Unprotect' button, which is what I need. Is there any other way to remove or disable the 'Unprotect/Protect' sheet icon on the Review tab?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Trap Unprotect Event

    Answer became obvious to me. I'll protect the sheets using a password known only to certain people. Then I'll create a new button on the QAT that will be used to unprotect the sheet but only after other user conditions are met.

Posting Permissions

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



Click Here to Expand Forum to Full Width