I have a password protect sheet, but want to give the user the option to run a macro, so i would like to build into the macro the password upfront to remove it, then run the macro, and then reapply the password. It is being applied on multiple sheets.
The first part works, where the password is removed, but the macro doesn't runs, and nor does it won't put the password back on. Please help
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Unprotect Password:="1234"
Next wSheet
MACRO (it works perfectly before doing the password stuff)
For Each wSheet In Worksheets
wSheet.Protect Password:="1234"
Next wSheet
End Sub
The first part works, where the password is removed, but the macro doesn't runs, and nor does it won't put the password back on. Please help
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Unprotect Password:="1234"
Next wSheet
MACRO (it works perfectly before doing the password stuff)
For Each wSheet In Worksheets
wSheet.Protect Password:="1234"
Next wSheet
End Sub