Sub Protect()
Dim FileName, FileDir, FileSearch As String
FileDir = “C:\My folder here\” ‘Change to suit
FileSearch = “*.xls”
FileName = Dir(FileDir & FileSearch)
Do While FileName <> “”
Workbooks.Open FileName:=FileDir & FileName
‘Workbooks(FileName).Protect Password:=”aa”, Structure:=True, Windows:=False
‘ActiveSheet.Protect Password = “aa”, Structure:=True, Windows:=False
ActiveSheet.Protect “aa”
Workbooks(FileName).Save
Workbooks(FileName).Close
FileName = Dir()
Loop
End Sub

Sub UnProtect()
Dim FileName, FileDir, FileSearch As String
FileDir = “C:\My folder here\” ‘Change to suit
FileSearch = “*.xls”
FileName = Dir(FileDir & FileSearch)
Do While FileName <> “”
Workbooks.Open FileName:=FileDir & FileName
ActiveSheet.UnProtect “aa”
‘Workbooks(FileName).UnProtect Password = “aa”
Workbooks(FileName).Save
Workbooks(FileName).Close
FileName = Dir()
Loop
End Sub