Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
An error handler handles errors in subordinate routine if they don't have
their own error handler. When the error is encounterd, the subordinate routine exits up to the next routine with an error handler. that is why the last msgbox in each subordinate routine is not executed: Sub test() On Error Resume Next MsgBox "test Before A err:" & Err.Number testa MsgBox "test After A err:" & Err.Number testb MsgBox "ending err:" & Err.Number End Sub Sub testa() Dim rng As Range MsgBox "In TextA Line1 err: " & Err.Number Err.Raise 5000 MsgBox "In TestA Last Line err:" & Err.Number End Sub Sub testb() Dim rng As Range MsgBox "In TextB Line1 err: " & Err.Number Err.Raise 6000 MsgBox "In Testb Last Line err: " & Err.Number End Sub -- Regards, Tom Ogilvy "Matt Jensen" wrote in message ... What is the 'scope' of On Error Resume Next? Is it for a sub, for the next line after the statement only, for a module, or for a workbook/project? If more than one of these, how does one specify the different ones? Thanks Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error Resume Next | Excel Programming | |||
On error resume next statement ignored! | Excel Programming | |||
ON ERROR RESUME NEXT | Excel Programming | |||
On Error Resume Next | Excel Programming | |||
On Error Resume Next | Excel Programming |