Solved

Problems with "On Error"

Posted on 2003-10-21
2
169 Views
Last Modified: 2010-05-01
Hi!

I'm developing an application under Visual Basic 6.0 and I'm not able to manage errors. It seems that VB doesn't allows me to take control on errors.

I've tried with On Error Goto <name_of_label>, On Error Resume Next... but when an error occurs, the application stops showing the error.

For example, with this code:
--------------------------------
On Error Resume Next

Err.Raise cdlCancel

MsgBox "Error number: " & cdlCancel
--------------------------------

The application stops on the "err.raise" line (the same happens if I use a label to handle the error)

Can anybody help me?

Thanks!
0
Comment
Question by:shalmorion
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 70 total points
ID: 9591798
Hi shalmorion,

Is this in the IDE or a compiled application? In the IDE you can set whether the application reacts in this way independently of any error handling you have, right-click the main code window, choose "Toggle" then see what is displayed for the error handling. You may have "Break on all errors" set. This will display the error message even if you have error handling.

Tim Cottee MCSD, MCDBA, CPIM
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 

Author Comment

by:shalmorion
ID: 9592297
Thanks a lot, TimCottee!!! I didn't knew this option.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now