Worksheet protection

A

adehart

I am working with a group of files that unfortunately were protected. Is
there a way in Windows Explorer that I can unprotect all the files in a
directory without having to open each file individually and select the
unprotect option.
 
V

vezerid

See if this macro does the job:

Sub BatchUnprotect()
Dim myFile
myFile = Dir("C:\Data\*.xls")
While myFile <> ""
Workbooks.Open myFile
Workbooks(myFile).Unprotect
Workbooks(myFile).Close
myFile = Dir
Wend
End Sub

HTH
Kostis Vezerides
 
Top