Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
when you put this line in the code, does it act for only
the next line or all lines after. If for the latter,is there a reverse of the statement to stop it? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Note: "all lines after" for the current procedure. If sub2 was
called from sub1, then exiting sub2 and returning to sub1 resets the error handler to sub1's, or the default. For instance: Public Sub Sub1() On Error GoTo A Sub2 Err.Raise 1 Exit Sub A: MsgBox "A" On Error GoTo 0 End Sub Public Sub Sub2() On Error GoTo B Sub3 Err.Raise 2 Exit Sub B: MsgBox "B" End Sub Public Sub Sub3() On Error GoTo C Err.Raise 3 Exit Sub C: MsgBox "C" On Error GoTo 0 End Sub The On Error GoTo 0 in Sub3 doesn't affect Sub2's call to B:, and Sub1's call to A: is not affected by sub2's call to B:. In article , "Phobos" wrote: "Jim" wrote in message ... when you put this line in the code, does it act for only the next line or all lines after. All lines after. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Document not saved" "error in loading DLL" | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Question on "On Error GoTo skip" | Excel Discussion (Misc queries) | |||
"Disk is Full" add-on question to "Can't reset last cell" post tod | Excel Discussion (Misc queries) | |||
Shortcut key for "Paste Options" and "Error Checking" buttons? | Excel Discussion (Misc queries) |