Hi All,
Can anyone help me how to do error handling with a sample code?
Thanks in advance.
Regards
Kumar
Hi All,
Can anyone help me how to do error handling with a sample code?
Thanks in advance.
Regards
Kumar
Something like
Please Login or Register to view this content.
Hi Kyle,
Thanks for you once again responding in this post also.
Actually I have some doubts on this concept.
->Is it enough to write like what you have sent.
What about try , catch concept in this Excel VBA.
Regards
Kumar
Try catch doesn't exist in vba
Kyle,
Thanks for that.
As per your given handler.I will get only the message of the error.
1->Along with that , Is it possible the error occurred in which line?
2->Is it possible to provide our custom messages?
Regards
Kumar
1. Not by default - I believe there are addins which can do this.
2. You can put whatever you like in a messagebox
Kyle,
What about
1. Error.HelpContext
2. Error.HelpFile
3. Error.LastDllError
4.Error.Raise
5 Error.Source
Regards
Kumar
Last edited by ravikumar00008; 07-25-2012 at 11:45 AM.
What about doing some research?
This site helps people who have issues, it isn't, nor could it be a comprehensive guide to learning all things VBA. Try having a google, there's loads out there - Chip Pearson's site will cover most of what you want.
Kyle,
Sorry for that.
There is a reason to ask you about those.
Because when i use Error.Number in a MsgBox , It is showing some number.Is it a line number or predefined code to identify that error?
Regards
Kumar
No, as I've already mentioned - you can't get the line number easily.
It is the error id
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks