Reputation: 155
I have a weird situation where a user is experiencing a run time error (which is expected and handled) except in this one case. From all the documentation that I've read for VBA error handling, if a sub procedure creates an error, the error is percolated up through the call stack until a procedure is found that has error handling and it is processed at that level. If no handler is found, then the run time error dialogue window is displayed. So...
Sub ProcedureA()
Try:
On Error Goto Catch
' No error handler in ProcedureB
ProcedureB
Catch:
If Err.Number <> 0 then
' Manages error from ProcedureB
End If
End Sub
This works for all users except one who had recently installed Excel 2016 (although there are other users with 2016 and no problems). In his case, the run time error dialogue window appears with the "scene of the crime" highlight pointing to a statement in ProcedureB (which has no error handler). My question then is if there is some setting in Excel or in its VBA options which would override the default VBA error handling behavior?
Upvotes: 1
Views: 340
Reputation: 2392
This isnt an issue with his Excel version. It is instead a setting within the VBE. From what I know, this isnt turned on by default, so either your user turned this setting on, or for one reason or another the default setting changed.
To fix this setting:
Then you should be all set. What was happening was the VBE settings were overriding the error handling behavior which can be beneficial for debugging, but is not so beneficial when someone is actually running your app.
Upvotes: 3