Automation error Exception occured

Rufus Clupea

Board Regular
Feb 11, 2019
Hi Folks,

Periodically, when opening & launching my project in Excel, I get an

Automation error
Exception occurred

nastygram, which then closes (crashes) Excel. It doesn't always happen, whether I've changed anything or not. The only way I've noticed that avoids it (after repeated attempts at starting the project) is going into Developer mode, opening the VBE, and then going from there back to Excel and launching the project.

Once I've gone through the aforementioned process, things work normally, and I can continue working on the project until the next time, when this may or may not happen again.

Any ideas/clues on how to fix this? I've looked at the Help Reference, but it's pretty much geek to me... :confused:

Last edited:


Well-known Member
Nov 1, 2008
DO you have any start-up macros? Disable all of them (by commenting them out). Then see if you can open normally, consistently. Next uncomment (in a smart way) the macro's bit by bit to see when the error starts again. There is your culprit.

Do you have any 'low level' programming in your macro, like capturing mouse events etc?

Rufus Clupea

Board Regular
Feb 11, 2019
DO you have any start-up macros?
No. Excel loads the Workbook fine. The first action to start things going is a simple clicking of a command button.
There are (currently) 2 command buttons; one clears the worksheet—that one works as expected, and doesn't cause the error. The other command button launches a UserForm (sans title bar).

Do you have any 'low level' programming in your macro, like capturing mouse events etc?
There are a couple of Subs that check if the mouse button is down and/or moving, so that the UserForm can be moved around. This allows me to check on the worksheet as different cells are filled with values (the Userform normally fills the entire screen). This doesn't happen until the UserForm is shown; the error occurs when clicking on the command button that causes the UserForm to be shown.

Forum statistics

Latest member
Wild Child

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...