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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.