+ Reply to Thread
Results 1 to 4 of 4

workbook Protection Toggle Macro

  1. #1
    Just Learning
    Guest

    workbook Protection Toggle Macro

    Does anyone have a macro for toggling workbook protection?

    E.g., run the macro and it unprotects the workbook if it's in a protected
    state and vice versa.

    Thanks for any help given!

  2. #2
    Don Guillett
    Guest

    Re: workbook Protection Toggle Macro

    try

    Sub protectunprotecttoggle()
    If ActiveWorkbook.ProtectStructure = True Then
    ActiveWorkbook.Unprotect Password = "d"
    Else
    ActiveWorkbook.Protect structure:=True, Windows:=False, Password:="d"
    End If
    End Sub

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Just Learning" <JustLearning@discussions.microsoft.com> wrote in message
    news:829EF55F-70CE-4AF0-852A-53432BF6832E@microsoft.com...
    > Does anyone have a macro for toggling workbook protection?
    >
    > E.g., run the macro and it unprotects the workbook if it's in a protected
    > state and vice versa.
    >
    > Thanks for any help given!




  3. #3
    Just Learning
    Guest

    Re: workbook Protection Toggle Macro

    Thanks! It works great!

    "Don Guillett" wrote:

    > try
    >
    > Sub protectunprotecttoggle()
    > If ActiveWorkbook.ProtectStructure = True Then
    > ActiveWorkbook.Unprotect Password = "d"
    > Else
    > ActiveWorkbook.Protect structure:=True, Windows:=False, Password:="d"
    > End If
    > End Sub
    >
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "Just Learning" <JustLearning@discussions.microsoft.com> wrote in message
    > news:829EF55F-70CE-4AF0-852A-53432BF6832E@microsoft.com...
    > > Does anyone have a macro for toggling workbook protection?
    > >
    > > E.g., run the macro and it unprotects the workbook if it's in a protected
    > > state and vice versa.
    > >
    > > Thanks for any help given!

    >
    >
    >


  4. #4
    Don Guillett
    Guest

    Re: workbook Protection Toggle Macro

    glad to help

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Just Learning" <JustLearning@discussions.microsoft.com> wrote in message
    news:9266646A-8C73-43DD-880C-CC4227D671CE@microsoft.com...
    > Thanks! It works great!
    >
    > "Don Guillett" wrote:
    >
    > > try
    > >
    > > Sub protectunprotecttoggle()
    > > If ActiveWorkbook.ProtectStructure = True Then
    > > ActiveWorkbook.Unprotect Password = "d"
    > > Else
    > > ActiveWorkbook.Protect structure:=True, Windows:=False, Password:="d"
    > > End If
    > > End Sub
    > >
    > > --
    > > Don Guillett
    > > SalesAid Software
    > > donaldb@281.com
    > > "Just Learning" <JustLearning@discussions.microsoft.com> wrote in

    message
    > > news:829EF55F-70CE-4AF0-852A-53432BF6832E@microsoft.com...
    > > > Does anyone have a macro for toggling workbook protection?
    > > >
    > > > E.g., run the macro and it unprotects the workbook if it's in a

    protected
    > > > state and vice versa.
    > > >
    > > > Thanks for any help given!

    > >
    > >
    > >




+ 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