Error 440, “Automation error”, means another application or library that VBA is controlling reported an error. That could be Word, Outlook, a database connection through ADO, or any object created with CreateObject. The error comes from that object, so Err.Description usually carries its own message, which says more than the number.
Show it while testing with a handler: On Error GoTo Handler at the top, and MsgBox Err.Number & ": " & Err.Description & " (" & Err.Source & ")" after the label. Err.Source names the application that raised the error.
The usual causes are a method that fails inside the other application, such as asking Word to open a file that isn’t there; a property the installed version doesn’t support; and security settings or IT policy blocking the program. Try the same action by hand in that application to see its own error message.
Don’t wrap automation code in On Error Resume Next as a fix. It skips the failing line, and the code carries on with an object that never did its job. Use it around a single call only, then check If Err.Number <> 0 Then straight after.
In VBA, Automation Error (440) occurs when you try to access Automation objects (objects that one application makes available to other applications or programming tools). It’s a run-time error that can occur while running a code. As Microsoft says, there could be the following reasons that make this error occur:
- An error occurs while your code runs a method or gets or sets a property of an object variable (like an object from Excel, Outlook or Word), and the application that created the object reports that error.
- Or you are trying to use an Office add-in that has been disabled by your system administrator.
How to Deal with Automation Error
The best way to deal with the automation error is to use the “On Error Resume Next” statement right before the line that accesses the object, and then check for the error right after that line. “On Error Resume Next” moves to the next line of the code irrespective of the error, so you can use the Err object to get information about the source and nature of the error.
Here’s how you can do it. In the code below, I have used Outlook from Excel to create an email. The “On Error Resume Next” sits right before the line that uses the object, and the next lines check the Err object. If there’s an error, the message box tells you its number, the application that reported it (Err.Source) and its description.
Sub CheckAutomationError()
Dim olApp As Object
Dim olMail As Object
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
On Error Resume Next
olMail.Display
If Err.Number <> 0 Then
MsgBox "Error " & Err.Number & " from " & Err.Source & ": " & Err.Description
Err.Clear
End If
On Error GoTo 0
Set olMail = Nothing
Set olApp = Nothing
End Sub
After the check, “On Error GoTo 0” turns the normal error messages back on, so the rest of the code doesn’t skip errors without you knowing. In the end, setting the object variables to Nothing releases the objects.
Steps to Fix Automation Error 440
Once you know which line and which application are behind the error, go through these checks:
- Read Err.Source and Err.Description: The error comes from the application that created the object (like Outlook, Word or Excel itself), so its description often tells you what went wrong with that method or property.
- Check the other application: Make sure it’s installed and still running. If it was closed or stopped responding while your code was running, the object variable no longer works.
- Check the references: In the Visual Basic Editor, go to Tools > References and look for any reference marked “MISSING:”. Untick it, or tick the right version of that library.
- Check the add-ins: In Excel, go to File > Options > Add-ins, select Disabled Items in the Manage box and click Go. If the add-in you need is in the list, enable it from there.
- Ask your administrator: If the add-in has been disabled by your system administrator, you can’t turn it back on yourself. In that case, you need to ask the administrator to allow it.
If none of these fixes it, run the code step by step with F8 and see the exact line where the error occurs. You can learn more about it in VBA Error Handling.
Frequently Asked Questions
What does Run-time Error 440 mean?
It means an Automation object (an object from Excel or another application) reported an error while your code was running a method or getting or setting a property of it. The application that created the object is the one that reported the error.
Can I just use On Error Resume Next to get rid of the error?
You can, but it only hides the error, and the line that failed still hasn’t done its job. Use it right before the line that accesses the object, check Err.Number right after it, and turn it off with On Error GoTo 0.
Why does the same code work on one computer but not on another?
The other computer might not have the same application or version installed, it might have a missing reference, or the add-in your code uses might be disabled there. Check Tools > References and the Disabled Items list on that computer.
Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.