S
steph
Hi group,
I've got this subs containing local error handling:
Private MySub()
On Error GoTo ErrTrap
Sub1
Sub2
...
Exit sub
ErrTrap:
If Err.Number = 18 Then
MsgBox "Error1"
Else
MsgBox "Error2"
End If
end
Sub1 and Sub2 do not contain any error handling.
My expection was that even if Error18 (User pressed <Esc>) happens in
Sub1 or Sub2 the error will propagate through to error handling of
MySub. But apparently that is not happening. Any ideas why this is so?
How can i change my code so that it's working as expected?
Thanks,
stephan
I've got this subs containing local error handling:
Private MySub()
On Error GoTo ErrTrap
Sub1
Sub2
...
Exit sub
ErrTrap:
If Err.Number = 18 Then
MsgBox "Error1"
Else
MsgBox "Error2"
End If
end
Sub1 and Sub2 do not contain any error handling.
My expection was that even if Error18 (User pressed <Esc>) happens in
Sub1 or Sub2 the error will propagate through to error handling of
MySub. But apparently that is not happening. Any ideas why this is so?
How can i change my code so that it's working as expected?
Thanks,
stephan