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
    2022-11-10T12:09:55+00:00

    What is working for me is to call another sub that does the work.

    In your example would work like this:

    Public Sub DoIt()

    MsgBox "Done"

    End Sub

    Public sub message()

    call Dolt

    end sub

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-11-10T17:27:09+00:00

    I get the same result - I still get the error if I try to call "message" fro Developer > Macros. But works fine if I F5 from the VBA window.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2022-11-30T22:31:56+00:00

    Hi, I just started my PC and it went back to normal. Shut down and turn on...that did it for me. :-)

    0 comments No comments
  4. Anonymous
    2022-12-01T18:43:45+00:00

    Unfortunately didn't help for me...

    0 comments No comments