unprotect when file is shared

K

Kashyap

Hi, I have the below code but when I share workbook it does't work.. any help
pls

Sub UnP()
Dim wks As Worksheet
Dim strPassword

strPassword = InputBox("Enter the password", "Password")

ActiveSheet.Unprotect Password:=strPassword
Range("A4:I1000").Select
Selection.Locked = False
ActiveSheet.Protect contents:=False
ActiveSheet.Protect Password:=ActiveSheet.Range("P1").Value
Application.Goto Reference:="R4C1"
Selection.End(xlDown).Select

On Error GoTo 0

End Sub
 
G

gmorris

First thing that comes to mind for me is version problems. I don't know
why, but when I try this in Excel2007 I get the error "Method 'Goto' of
object '_Application' failed". Why it has the underscore is a mystery to
me, I can only guess that it has something to do with the (most likely
C++) code that drives Excel. Possibly someone changed the method or
something before releasing 2007 version, but I'm not at all sure. That's
just my thoughts...
 

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