|
-
Jan 17th, 2000, 06:28 AM
#1
Thread Starter
Junior Member
I'm trying to implement error handling in my program. I don't want to have to put "On Error Goto ErrorHandler" in every sub or function. It becomes tedious! Does anyone know any other way around this?
TIA,
XinMan
-
Jan 17th, 2000, 06:33 AM
#2
Member
I don't think there is away around that one. In order for every procedure to become error handled, you must have the On Error statment at the top of each one.
But I may be wrong....
------------------
David Underwood
Cannabatech Corporation
ICQ - 14028049
E-mail - [email protected]
-
Jan 17th, 2000, 07:17 AM
#3
Try putting it in the Declarations (Dont know if it'll work ) section but according to MSDN you will need it for every procedure.
Glenn Harwood
-
Jan 17th, 2000, 09:53 AM
#4
Yes, every routine that needs error handling needs to have its own On Error Goto... statement. Have you ever just copied an existing routine and just changed it to suit your needs (leaving the On Error... of course)?
------------------
Marty
-
Jan 17th, 2000, 06:37 PM
#5
Junior Member
I've noticed that if you have a sub/function with an error handling routine and from that sub call another sub the error handler is still active which means that the sub you called don't need any error handling.
-
Jan 17th, 2000, 07:13 PM
#6
Hyperactive Member
True, and it depends on what kind of function it is if it needs error handling....
and yes, it would be very kewl if you could add a line in the declarations like
On Error Goto errorhandlersub
and that that sub gets called when an error occured.. including function name of course that got the error :-)
but until then, the best i can come up with is write an addin which will add error handling to every sub and function..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|