[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vba error code not catching error number

Posted on 2014-04-09
4
Medium Priority
?
388 Views
Last Modified: 2014-04-09
vba 2010.
excel

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

It is not catching the error 424 ?


ErrHandler:
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
    rs.Close
     db.Close
       Set rs = Nothing
         Set db = Nothing
           UserForm2.ListBox47.Clear
Exit Sub
End If



Thanks
fordraiders
0
Comment
Question by:Fordraiders
4 Comments
 
LVL 28

Accepted Solution

by:
MacroShadow earned 1000 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):
?Err.Number
Hit enter. What is the number?

Alternatively attach a sample so we can debug it.
0
 
LVL 50

Assisted Solution

by:Martin Liss
Martin Liss earned 1000 total points
ID: 39989487
Please show the complete procedure that contains that code.
0
 
LVL 35

Expert Comment

by:Norie
ID: 39989566
Perhaps some other error has occured before the 424 error you expect?
0
 
LVL 3

Author Closing Comment

by:Fordraiders
ID: 39990732
Thanks..commented and found a previous error.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

834 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