Solved

Problems with "On Error"

Posted on 2003-10-21
2
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

730 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