vba error code not catching error number

Posted on 2014-04-09
Last Modified: 2014-04-09
vba 2010.

I have code that is to capture a specific error number.

It is not catching the error 424 ?

If Err.number = 424 Then
         MsgBox "You May Have Data that Contains Extra Special Characters.Please Verify Your Cut and Paste or Typing entry.", vbCritical, "Description Search Error" 'On Error Resume Next
       Set rs = Nothing
         Set db = Nothing
Exit Sub
End If

Question by:fordraiders
LVL 26

Accepted Solution

MacroShadow earned 250 total points
ID: 39989319
If you comment the error handling do you run into an error? If so type in the immediate window (ctrl+G to open it):
Hit enter. What is the number?

Alternatively attach a sample so we can debug it.
LVL 45

Assisted Solution

by:Martin Liss
Martin Liss earned 250 total points
ID: 39989487
Please show the complete procedure that contains that code.
LVL 33

Expert Comment

ID: 39989566
Perhaps some other error has occured before the 424 error you expect?

Author Closing Comment

ID: 39990732
Thanks..commented and found a previous error.

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

708 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

15 Experts available now in Live!

Get 1:1 Help Now