'On Error Resume Next' stopped working

hatman

Well-known Member
Joined
Apr 8, 2005
Messages
2,664
It seems counterintuitive, but the following code:

Code:
Sub stuff()
    Dim a As Range
    Dim b As Variant
    
    On Error Resume Next
    
    b = a.Address
 
End Sub

Actually displays the error message that would be expected if the error handler hadn't been suppressed. Has anyone seen this? I have at least a dozen computers that have suddenly started exhibitting this behaviour, after installing an Addin that I helped a co-worker develope. Well, I gave him a little guidance and a little bit of code... he's at least as good as me with a slightly different focus.

What's worse, even after uninstalling his addin and restarting Excel, the problem doesn;t go away. It is wreaking all kinds of havoc with people who are trying to use one of MY addins that is doing a lot of things like the following:
Code:
set object = nothing
 
on error resume next
 
set object = rnge.find "text"
 
on error goto 0
 
if not object is nothing then
...

It's blowing right through until it pops up the With or Object Variable Not Set (or whatever the exact error message says). It shouldn't. I don't get it, and I am not really sure where to start. I could use some big guns on this, please.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Howdy!

Have you checked in your VBE Prefernces in Tools>Options>General tab that you don't have "Break on all errors" selected?
 
Upvote 0
:rofl:

Yup, that's it.

:confused:

How can this get tweaked programatically? I have at least a dozen machines affected that I know abot. Nobody went onto their machines to change this setting.
 
Upvote 0
Perhaps it's been changed in another Office application?

I know that when I change it in Access it changes in Word and Excel.
 
Upvote 0
Okay, yeah, I forget that many of these settings are global across Office Apps. However, what you are implying is that someone went into the VBE editor in Access, changed the setting there, and now it is set everywhere. I could accept that explanation if it happened on one or two machines where the user is a VBA nut like me. But I'm talking about users who may know that VBA exists, but only stumble into it when there is a debug error, at which point their eyes roll up into their heads, and they close the aplication and restart. This setting seems to have been set on multiple machines, effectively simultaneously, by the apparent act of installing an addin (that I have since reviewed, and can't find anything strange).

I'm mystified...
 
Upvote 0
I don't know who has access to do something like this.

Perhaps it's a 3rd party application/add-in that sets the options programatically?

As far as I'm aware you can't do that in Excel but you can in Access.
Code:
Application.SetOption "Error trapping", [0|1|2]
 
0 - Break On All Errors
1 - Break in Class Module 
2 - Break On Unhandled Errors
That will apply across Office, though not to other open applications.
 
Upvote 0
How very intersting. I need to keep an eye on this. I have rest this on a few computers, and basically asked teh users to "play" but keep tracj of what they are doing, so we can track this if it resets again...

Thanx guys!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top