How to programmatically set Error Trapping in VBE

  • Thread starter Thread starter Tim Zych
  • Start date Start date
T

Tim Zych

When I use error handling, it will be ignored if VBE's Error Trapping
setting is set to "Break On All Errors".

Therefore the following code would produce an error.

On Error Resume Next
Msgbox 5/0

Is there a way to programmatically set Error Trapping to "Break On Unhandled
Errors"?

Thanks
 
I *think* this is what you're driving at.

On Error Resume Next
MsgBox 5 / 0
If Err <> 0 Then
MsgBox ("Error:= " & Err)
End If
 
You can't change the error handling programmatically. (Well, I suppose
it is stored somewhere in the registry, so I guess it is technically
possible.) But generally, this is a manual setting.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top