Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Defined Error Code/Numbers in Visual Basic 6.0

Status
Not open for further replies.

kuttapan

Programmer
Jan 27, 2005
11
US
Hello,

I am trying to get a list of ErrorCode/Numbers that I could use in my program that does not conflict with Visual Basic Error Code.
I did my research and found two sites.

1)
This is a msdn article, but this basically lists the Error Codes for "Visual Basic for Applications". Since I wanted Visual Basic specific error codes i did further serach and found the site below.

2)
This is a more complete list of Visual Basic Error Codes.

Could someone please help me confirm if this list in the second link is the exact one or is there a set of Error Codes that I could use for my program? Any link will be appreciated.

Thanks,
Kuttapan
 
Err.Number = vbObjectError + MyCustomError


????
 
Sheco,

In my program I am not trying to create a external error file which will be a xml file. Ok this is what i am trying to do.

I am creating an external xml file that will list all the errors that can result from my application (not Visual Basic Errors) and also all the possible Visual Basic errors. I specify the action for each error in my xml. So when a specified error in the xml happens the appropriate action specified in the xml is done.

For this i need the list of error codes that i can use in my xml for my application errors that will not conflict with the Visual Basic errors. This is the reason I am trying to find a range of error numbers that I can use for my application errors.
 
Try this:
Code:
    Dim n As Long
    
    On Error Resume Next
    
    For n = 1 To 9999
        If Mid(Error(n), 1, 3) <> "App" Then Debug.Print n, Error(n)
    Next

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top