On error

K

Kashyap

Hi, I have code as below which will update links..

On error sheet will be unlocked.. how to lock the sheet again and exit sub?

Sub ref()

ActiveSheet.Unprotect Password:="abc"

ActiveWorkbook.UpdateLink Name:= _
"asdasd", _
Type:=xlExcelLinks

ActiveSheet.Protect Password:="abc"

End Sub
 
K

Kashyap

Thanks Jacob..

Jacob Skaria said:
Try using the On Error statement.. Refer the below link

Sub ref()

On Error GoTo Handler

ActiveSheet.Unprotect Password:="abc"
ActiveWorkbook.UpdateLink Name:= _
"asdasd", Type:=xlExcelLinks
ActiveSheet.Protect Password:="abc"

Handler:
ActiveSheet.Protect Password:="abc"

End Sub


If this post helps click Yes
 

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