Unexplained "Automation error Exception occurred" from Excel

Anonymous
2022-07-27T20:20:04+00:00

I'm getting "Automation error Exception occurred" (+ crash) from Excel 2016 for all macros for all workbooks. Started happening some time in the last week (same code worked fine last week)

I created a test case, empty workbook with a single module.


Option Explicit

Option Base 1

Public Sub DoIt()

MsgBox "Done" 

End Sub


If I run it with F5 from inside the VBA editor, it works fine.

If I run it from Developer > Macros > DoIt, error + crash.

I tried doing a "repair" of my office installation, no change.

Thoughts?

Microsoft 365 and Office | Excel | For business | 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
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-12-01T17:58:33+00:00

    Here's the solution (since my problem hadn't gone away).

    • Open the VBA editor (Alt + F11)
    • Tools > References
    • check-mark "AccessibilityCplAdmin 1.0 Type Library"
    • SAVE
    • (close and reopen Excel)

    I learned this in Stack Overflow and it worked like a charm.

    155 people found this answer helpful.
    0 comments No comments

13 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-05-08T01:20:53+00:00

    I had this happening and figured out it was ONLY if the file was stored on my OneDrive folder. If I moved the workbook file back to C drive or anywhere else, such as a normal network drive, the same macro worked.

    1 person found this answer helpful.
    0 comments No comments