Module error
Posted: Mon Nov 22, 2004 2:12 am
Hi all
Can somebody enlighten me as to how you can enable an error handler in
multiple modules.
In the main module you can write:
On Error goto Myhandler
at the entry point into the program.
However if the other modules only contain Sub's and Functions then
placing:
On Error goto Handler2
before the subs, means the handler never gets enabled and the error
get's trapped back in MyHandler in the main module.
Yet the help files refer to Module Level Error Handlers.(as in plural)
I have tried calling a sub in Module2
SUB ERRMOD2
ON ERROR GOTO ERRTRAP2
EXIT SUB
ERRTRAP2:
Resume Next
END SUB
But that gives a compile error
005D 0006 ERRTRAP2:
^ Subprogram error
I don't want to use ON LOCAL ERROR as it is local only to that routine.
Any ideas appreciated
Regards
Can somebody enlighten me as to how you can enable an error handler in
multiple modules.
In the main module you can write:
On Error goto Myhandler
at the entry point into the program.
However if the other modules only contain Sub's and Functions then
placing:
On Error goto Handler2
before the subs, means the handler never gets enabled and the error
get's trapped back in MyHandler in the main module.
Yet the help files refer to Module Level Error Handlers.(as in plural)
I have tried calling a sub in Module2
SUB ERRMOD2
ON ERROR GOTO ERRTRAP2
EXIT SUB
ERRTRAP2:
Resume Next
END SUB
But that gives a compile error
005D 0006 ERRTRAP2:
^ Subprogram error
I don't want to use ON LOCAL ERROR as it is local only to that routine.
Any ideas appreciated
Regards