Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I want to disable progammatically the VBE "Break on all errors" option when launching a VBA Add-in that contains handled errors. I read the Microsoft Knowledge Base Article (ACC2000: How to Turn Off "Break on All Errors" Option in Code View) on the process that should be used to do this with Access. That approach appears to work with Microsoft Excel VBA Add-ins if a reference to DAO is included. The approach is broadly to include the following two subs in the add-in: Public Sub SuspendBreaks() SetOption "Error Trapping", 2 End Sub Public Sub ResumeBreaks() SetOption "Error Trapping",0 End Sub These two subs are then incorporated into your procedures as follows: Function MyCodeModule() SuspendBreaks On Error GoTo MyCodeModule_Err MyCodeModule_Exit: ResumeBreaks Exit Function MyCodeModule_Err: Resume MyCodeModule_Exit End Function I have read often that there is no reliable method of disabling Break-On-All-Errors. As an inexperienced programmer, I was wondering if anyone had tried this approach and knew whether it is reliable when the VBA add-in is widely distributed. What are its limitations? Does it work or am I mistaken? What are all the other options for the first argument that in this case contains a string "Error Trapping" (but is meant to be a long)? Any thoughts would be much appreciated. Regards Jeremy -- Jeremy Sadleir |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBE Options: Disabling Debug Option on All Errors | Excel Programming | |||
Programmatically Disabling Excel Toolbars for one session only? | Excel Programming | |||
How do I set VB to Break on All Errors? | Excel Programming | |||
Disabling the CONTROL + BREAK shortcut key function - HAVING PROBLEM - MY CODE DOES NOT WORK | Excel Programming | |||
How to Programmatically Insert a Page Break Every Nth Row in a Range | Excel Programming |