Solved

Problems with "On Error"

Posted on 2003-10-21
2
168 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

707 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

13 Experts available now in Live!

Get 1:1 Help Now