Share via

Excel VBA "On Error ..." functions no loner working

Anonymous
2020-04-09T18:52:52+00:00

Hello,

I recently realized that none of the VBA "On Error" functions are working anymore. 

Excel is managed through our company.

It is Microsoft Office 365 ProPlus.  Version is 1908 (build 11929.20606 Click-to-run)

365 MSO (16.0.11929.20436) 32 bit

Here are two simple examples that are not working.

Sub OnErrorTest()

Dim i As Integer

'Both of these throw an error msg: "Unable to get the Find property of the WorksheetFunction class"

On Error Resume Next

    i = Application.WorksheetFunction.Find("z", "Find text in a string", 1)

On Error GoTo 0

On Error GoTo Err

    i = Application.WorksheetFunction.Find("z", "Find text in a string", 1)

On Error GoTo 0

Exit Sub

Err:

    MsgBox "Error msg"

End Sub

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2020-04-09T19:45:32+00:00

Then it sounds like your option to only break on unhandled errors got reset to break on all errors.

Goto Tools /  Options.....   General tab,  then make sure that "Break on unhandled errors" is selected.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-04-09T19:33:08+00:00

    Hi Bernie,

    Thanks for the suggestion, but unfortunately there are no "Missing" references. 

    I only have 5 selected:

    Visual Basic for Applications, MS Excel 16.0 Object Library, OLE Automation, MS Office 16.0 Library & MS Scripting Runtime.

    Should I have something selected that is not??

    -Darin

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-04-09T19:38:31+00:00

    Thanks for the suggestion Dana!

    I just did this as a simple example.  I have many "On Error" functions that I dont have a fixes for.

    -Darin

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2020-04-09T18:58:09+00:00

    That could indicate a missing reference in your project - check Tools / References and see if there is a reference marked "Missing"

    Was this answer helpful?

    0 comments No comments