none
How can I disable going to help with error message in vba?

    Question

  • While debugging when I get an error, the message box pops up with OK and Help buttons.  If I have been tabbing through controls on a form and accidentally hit the tab key, I frequently hit the tab key after the error and then may hit the enter key, but the focus is on the help button and a browser help windo opens up when I don't want it to.  Is there a settting where I can disable this action, or create a new dialog that would replace the Ok or get help choices?

    I have no trouble getting help when I want it.

    Tuesday, September 10, 2013 2:25 AM

Answers

  • If you put error handling in your code you can have it behave the way you want it to. Without error handling, this is how it is. Question is, what you want to have happen when an error is encountered...

    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, September 10, 2013 10:38 AM
  • Hi Jerry

    Ah, yes, I've done that...

    I don't think there's any way to change how the built-in notification works, no.

    As you say, you'd have to build your own logging or messaging system. What I have seen developers use is a Constant declaration in their code, assigned to various values. Depending on the value, the Error handler does one thing, or another. That might be the best way to implement a personal "debug mode" vs. "release mode".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by bones216 Saturday, June 14, 2014 8:45 PM
    Monday, December 23, 2013 4:59 PM

All replies

  • If you put error handling in your code you can have it behave the way you want it to. Without error handling, this is how it is. Question is, what you want to have happen when an error is encountered...

    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, September 10, 2013 10:38 AM
  • Cindy, I do have error handling in code but when debugging I reset it to On Error goto 0.  I want to see the error message, but frequently when it comes up I have inadvertently hit tab so the focus goes to Help instead of OK and then I have a help screen I didn't want.  My question was how to disable it going to help so easily. I guess the answer is to make my own message box to override the systems.  I know that if I slow down and think about it I wouldn't have the problem, but in the intensity of debugging that's hard to do.

    Jerry McManus

    Thursday, December 19, 2013 5:45 PM
  • Hi Jerry

    Ah, yes, I've done that...

    I don't think there's any way to change how the built-in notification works, no.

    As you say, you'd have to build your own logging or messaging system. What I have seen developers use is a Constant declaration in their code, assigned to various values. Depending on the value, the Error handler does one thing, or another. That might be the best way to implement a personal "debug mode" vs. "release mode".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by bones216 Saturday, June 14, 2014 8:45 PM
    Monday, December 23, 2013 4:59 PM