Worksheet protection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top