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
Private Sub UserForm_Initialize() Dim Protection As Boolean ' Want to get the current state of protection here ' Protection = some magic code here! If Protection = True Then ' Set drop down list to On Else ' Set drop down list to Off End If End Sub
Bookmarks