tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,832
- Office Version
- 365
- 2019
- Platform
- Windows
How long does On Error Resume Next last?
I thought it lasts until the end but according to this example, it doesn't.
Module1:
Module2:
Module3:
Running Sub A, the code stops after Sub 2 is run. It never gets to Sub C.
Why is that?
Thanks
I thought it lasts until the end but according to this example, it doesn't.
Module1:
Code:
Option Explicit
Sub A()
On Error Resume Next
Dim aa
aa = 1 / 0
Call Module2.b
End Sub
Module2:
Code:
Option Explicit
Sub b()
Dim bb
bb = 1 / 0
Call Module3.c
End Sub
Module3:
Code:
Option Explicit
Sub c()
Dim cc
cc = 1 / 0
End Sub
Running Sub A, the code stops after Sub 2 is run. It never gets to Sub C.
Why is that?
Thanks