Hi Everyone,
Im hoping someone may be able to help me out.
I have a large selection of excel files within folders that I need to process.
Some files have protected worksheets and some don't
I have the password required but Im trying to find a way that I can get a macro to go through all the excel workbooks within a folder and sub folders, check if it has protected worksheets (of which there may be one or many), then unprotect all the worksheets, save the work book and close it then move on to the next.
The script I am using to unprotect all the worksheets is:
Sub ProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd
Next wSheet
End Sub
any help would be greatly received thank you
Im hoping someone may be able to help me out.
I have a large selection of excel files within folders that I need to process.
Some files have protected worksheets and some don't
I have the password required but Im trying to find a way that I can get a macro to go through all the excel workbooks within a folder and sub folders, check if it has protected worksheets (of which there may be one or many), then unprotect all the worksheets, save the work book and close it then move on to the next.
The script I am using to unprotect all the worksheets is:
Sub ProtectAll()
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd
Next wSheet
End Sub
any help would be greatly received thank you