"Debug" option in custom error message (1 Viewer)

SteveClarkson

Registered User.
Local time
Today, 21:55
Joined
Feb 1, 2003
Messages
439
Hello,

In my error handling code, I usually have a final "anything else" bit, which should display a message showing the error number and description.

Is there a way to add a button that will bring up the standard VBA "Debug" screen, highlighting the error in the code?


Thank you!
 

tehNellie

Registered User.
Local time
Today, 21:55
Joined
Apr 3, 2007
Messages
751
Problem would be that the issue has triggered your error handling to display the message, when you get taken to the debug window you'll be at the point in your error handling bringing up your msgBox rather than specifically where the error occurred.

Ctrl+Break at your error message will give you the option to debug, I'm sure there's a way to code this, but given the time taken to learn pressing ctrl+break and writing a button to do this for me, I couldn't see the advantage.
 

SteveClarkson

Registered User.
Local time
Today, 21:55
Joined
Feb 1, 2003
Messages
439
No - that is brilliant - the perfect solution in fact!

I don't REALLY want my users to get in there, as they will get scared and confused, and probably start randomly fiddling with things!

So - a keyboard shortcut like this is perfect!


Thank you!
 

tehNellie

Registered User.
Local time
Today, 21:55
Joined
Apr 3, 2007
Messages
751
You'll still be at your error handing rather than specifically where the error occurred but I'd think that is still enough to give you a pretty good idea at least which module/procedure errored to enable you to stick a break point in.
 

Users who are viewing this thread

Top Bottom