- I have a folder with .xlsb workbooks.
- Each workbooks has 5 sheets, all of them protected with a password.
- The password is common for all sheets, for all workbooks.
- The workbooks themselves have no password.
How can I unprotect all the sheets of all the workbooks and saved them as unprotected?
I found the following code but it fails to do what I need (it works for only the active workbook).
Sub unprotect_all_sheets()
On Error Goto booboo
unpass = InputBox("password")
For Each Worksheet In ActiveWorkbook.Worksheets
Worksheet.Unprotect Password:=unpass
Next
Exit Sub
booboo: MsgBox "There is s problem - check your password, capslock, etc."
End Sub