Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
On error
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
On error
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 --------------- Jacob Skaria "Kashyap" wrote: 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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
On error
Kashya, this time with the link.
http://www.excel-vba.com/vba-code-2-2-error.htm If this post helps click Yes --------------- Jacob Skaria "Kashyap" wrote: 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 |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
On error
Thanks Jacob..
"Jacob Skaria" wrote: 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 --------------- Jacob Skaria "Kashyap" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
I have Error 1919 Error Configuring ODBC dataSource Database | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |