Automatically add error handling to code

I would like to be able to automatically add a custom error handling routine to my code and would like to know how to code a function or procedure to do this.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

InteqamConnect With a Mentor Commented:
the answer of this Q is Waty's profile

I have working in VB3, VB4, VB5, VB6 since 1993, MCP VB3, VB4, VB5. I also have knowledge in C++, databases, NT, Unix.
I am the webmaster of the site "VB Diamond Source code and Freeware"
You will find on this web site sharewares I wrote like
   VBIDEUtils, VBCodeDatabase, Print Preview OCX, Textbox Calendar OCX, Logger OCX and a lot of other useful sources

Try them.
   Web Site : 

You can reach me at :
ICQ : 35353612 but only during evening time (GMT+1)

see VBIDEUtils
In each of your methods, why can't you add an On Error Statement?

for ex.

Private Function Myfunc()integer
on Error goto Error_Handler
MyFunc=1 'successful
exit function

'your error handling code here
exit function

I think this is the way most do it. here you can do anykind of error checking and do whatever u want according ot the situation.

And what do u mean by automaticaly adding???

one product i can recommend is Failsafe by Numega

or you could write a Com addin for VB that did just what you wished
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

dear eetaz,

i prefer to use Auto Error Handler..
you can download from if you want

if you want to use more.. please register..

that software will fill your form, module, project with the code that you want.. automaticaly just by one touch..


eetazAuthor Commented:
I know about the shareware options available, I wanted to learn how this type of coding worked. Thanks for your response
eetazAuthor Commented:
Thanks to all of you who took the time to respond. I am new to VB and want to learn new coding techniques and how they work. I have a shareware program that does the auto inserting of error code, I really wanted to see how to code something like that. Thanks again.
All Courses

From novice to tech pro — start learning today.