+ Reply to Thread
Results 1 to 5 of 5

How to get workbook protection status?

  1. #1
    Registered User
    Join Date
    01-04-2011
    Location
    West Yorks, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    How to get workbook protection status?

    I want to write a simple macro that allows the user to turn workbook protection on and off via a userform.
    When the form starts up I want to set a drop down list to show one of On or Off options.
    But I don't know how to find out if protection is already on or off. Can anyone help?

    Here's my function

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 01-04-2011 at 01:21 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to get workbook protection status?

    Welcome to the Board, please be sure to use CODE tags when posting VBA.

    Given first post I've modified for you but going forward please bear the above and other Forum Rules in mind when posting

    Thanks in advance.

    In terms of answer - you might be looking for

    Please Login or Register  to view this content.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,247

    Re: How to get workbook protection status?

    Check the ProtectStructure and ProtectWindows properties of the Workbook.
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    01-04-2011
    Location
    West Yorks, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to get workbook protection status?

    Quote Originally Posted by DonkeyOte View Post
    Welcome to the Board, please be sure to use CODE tags when posting VBA.

    Given first post I've modified for you but going forward please bear the above and other Forum Rules in mind when posting

    Thanks in advance.

    In terms of answer - you might be looking for

    Please Login or Register  to view this content.
    Thanks for the quick response

    That works fine (will try to remember the code tags next time too)

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to get workbook protection status?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1