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!
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!
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!
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!
>
>
>
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!
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks