Need help removing protection from XL2007 wkbook, please

E

Ed from AZ

I have inherited an XL2007 workbook that was protected for sharing for
multiple users over a network. I have the password. What I don't
have is the understanding of how it was protected. I tried

Sub UnlockMe()

Dim wkb As Workbook
Dim wks As Worksheet
Set wkb = Workbooks.Open("C:\Documents and Settings\MyFile.xlsx", _
, False, , "password")

wkb.UnprotectSharing ("password")

For Each wks In wkb.Worksheets
wks.Unprotect ("password")
Next wks

MsgBox "Done!"

End Sub

This failed on the first wks.Unprotect - a glance at the locals window
says the wkb and wks objects have no variables.

In Review >> Changes, Unprotect Sheet is disabled, and there isn't any
Unprotect Workbook or Unprotect Shared Workbook.

What am I missing about protection here?

Ed
 
E

Ed from AZ

Okay - I found that I can accomplish this by *first* removing the
share! Didn't know that before. Hope this helps someone else.

Ed
 

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

Top