Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:59:28+00:00 2026-06-18T11:59:28+00:00

I’ve been using VBA in Excel for a while, and I use a custom

  • 0

I’ve been using VBA in Excel for a while, and I use a custom error handler for all of my procedures. I find myself, for the first time, in the position of needing to useErr.Raise (to deal with a Case Else situation in a Select Case block)., and I can’t figure out how pass the error to the custom error handler. Instead of passing the raised error to the custom handler, VBA pops up its own ugly and fairly useless error dialog. If anyone can tell me a way to get around this I’d be very appreciative.

Below is a genericized version of the code I’m using (function/variable names have been changed to protect the innocent). The gErrorHandler object is a globally dimensioned class module variable which handles errors from any and all procedures.

Public Function MyFunction(dblInputParameter As Double) As Double
On Error GoTo Err_MyFunction

    Dim dblResult as Double

    Select Case dblInputParameter 

        ...Several case statements go here...

        Case Else
            Err.Raise vbObjectError + 1000, "MyProjectName.MyObjectName", "Error Description"

    End Select

    MyFunction = dblResult

Exit_MyFunction:
    Exit Function

Err_MyFunction:
    gErrorHandler.DisplayError Err.Number, Err.Description, Erl, csModule, "basMyModuleName", "MyFunction"
    Resume Exit_MyFunction

End Function

And here’s the error dialog I get instead of having the error passed to the custom handler:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:59:30+00:00Added an answer on June 18, 2026 at 11:59 am

    As Tim pointed out in his comment, the answer was that the VBA IDE was configured to break on all errors. Changing it to break on unhandled errors only gave me the behavior I desired.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am confused How to use looping for Json response Array in another Array.
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.