Consulting

Results 1 to 4 of 4

Thread: Solved: Preventing Workbook & Sheet Protect

  1. #1
    VBAX Regular
    Joined
    Jan 2009
    Posts
    57
    Location

    Solved: Preventing Workbook & Sheet Protect

    Can a workbook be coded to prevent users from using the Tools-Protect Sheet or Protect Workbook menu options?

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    You could try this line (untested)[VBA]CommandBars("Worksheet menu bar").Controls("Tools").Controls("Protection").Enabled = False
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Regular
    Joined
    Jan 2009
    Posts
    57
    Location
    I managed to find something else similar before the forum crashed and change it a little to this:

    Application.CommandBars("Tools").Controls("Protection").Enabled = False

    which works fine.

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    If you query is now solved could you mark the thread solved by going to Thread Tools>Mark Thread Solved
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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