• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Break on Unhandeled Error

Debraj

Excel Ninja
In my macro, I often use "On Error Resume Next", but in some PC, my Colleagues set their

"VBA > Tools > Option > General > Error Tapping" as Break on all errors, and my macro fail to "Goto ErrorHandler".

I need a object (something like Application.ErrorCheckingOption) to set Error Tapping option to "Break on Unhandeled Error" = TRUE, and again rollback to old Error Tapping option.

Thanks in advance..
 
Looks like you need:

Code:
Application.SetOption "Error Trapping", 2


Refer:

http://www.fmsinc.com/tpapers/vbacode/debug.asp

&

http://www.excelforum.com/excel-programming/514191-disabling-vbe-break-on-all-errors-programmatically-with-dao-setopt.html
 
Thanks Hui.. I am a big FAN of you..

above both reference are enough for me to argue with my TESTING team.. :)

'Application.GetOption & Application.SetOption, both needs Tools > Reference.. "Microsoft DAO 3.6 Library.DLL,

Unfortunately..this DLL is not available in my system. Don't worry, I will fix it from my VB6 :)
 
Back
Top