Solved run-time error 429 activex component can't create object

October 23, 2018 at 16:21:19
Specs: Windows 7
I have an excel sheet that works just fine on all but 2 computers, they all have office 2016 installed. When
I try to use the automation of an email from excel I get the run-time error 429, activex component can't
create object. the debug lands on the createobject("outlook.application") part of my code. There is a lot
of information on this error and I have tried many things to no avail. Here is my code, can anyone help?

Sub Email_All_Options()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Dim Signature As String
Dim MyNote As String
    
If Sheets("Closing Costs").Range("C80").Value > 0 
Or Sheets("Closing Costs").Range("D80").Value > 0 
Or Sheets("Closing Costs").Range("E80").Value > 0 Then
MyNote = "There is a DISCOUNT POINT listed, are you ok with that?"
Answer = MsgBox(MyNote, vbCritical + vbYesNo, "Ratios Check")
    If Answer = vbNo Then
        Exit Sub
    End If
    End If
Set rng = Nothing
' Only send the visible cells in the selection.

Set rng = Sheets("Closing Costs").Range("B56:E84")


If rng Is Nothing Then
    MsgBox "The selection is not a range or the sheet is protected. " & _
           vbNewLine & "Please correct and try again.", vbOKOnly
    Exit Sub
End If

With Application
    .EnableEvents = False
    .ScreenUpdating = False
End With

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
   .Display
End With
Signature = OutMail.HTMLBody
StrBody = "Thank you for trusting me with your home financing; as discussed here are your Loan options, 
please call me to discuss. "

With OutMail
    .Subject = "loanDepot Mortgage Options for " & Worksheets("Main").Range("F5").Value
    .HTMLBody = "<BODY style=font-size:12.5pt;font-family:Calibri>" & "</p>" & StrBody & RangetoHTML(rng) 
& Signature
    .Display
End With

On Error GoTo 0

With Application
    .EnableEvents = True
    .ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

message edited by mecerrato


See More: run-time error 429 activex component cant create object

Reply ↓  Report •

✔ Best Answer
October 26, 2018 at 05:01:54
I was able to uncover the culprit of this issue and it had nothing to do with any of the recommended remedies. It was the antivirus policy that was blocking the macro script, not sure why yet and haven't been able to fix it permanently but a work around was to move the file to the c:\scripts folder that is excluded from the antivirus policy and it now runs perfectly. I am waiting on our corporate IT to figure the antivirus part out because I don't have access to investigate. I was able to find this through the windows event viewer that is where I saw that the macro script was being blocked. Hope this helps other folks that are on that same wild goose chase I was on.

Does anyone know how I can mark my this reply as the best answer for other folks to find?

message edited by mecerrato



#1
October 23, 2018 at 16:53:32
The script can't find Outlook. Either you don't have the Outlook application installed on those machines, those machines has a version of Office that doesn't include the "Outlook.Application" COM object (probably click-to-run), or the Office install is corrupt on those systems.

How To Ask Questions The Smart Way


Reply ↓  Report •

#2
October 23, 2018 at 16:59:00
Outlook is installed on all machines (it is our default mail app).
How do I check for the "Outlook.Application" COM object
How do I check if the version installed is click-to-run?

I tried the repair function which took about 45 minutes and ahd me restart machine but it did not work.


Reply ↓  Report •

#3
October 23, 2018 at 17:06:01
In 2010, in Excel, it's on the File -> Help screen, near the full version number of Excel. Not sure where it'd be in Outlook 2016.

Another option is Excel or Outlook is using 32-bit, while the other is 64-bit, but that shouldn't happen unless two different Office bundles were installed to those systems.

How To Ask Questions The Smart Way


Reply ↓  Report •

Related Solutions

#4
October 23, 2018 at 17:22:21
Ok I just checked that both are the MSI full versions (I found a few ways of checking online) and I also confirmed that both excel and outlook are running 32 bit versions.

any other suggestions? and by the way, thank you :-)


Reply ↓  Report •

#5
October 24, 2018 at 12:11:40
anyone else have any ideas that can solve this issue?

Reply ↓  Report •

#6
October 24, 2018 at 13:00:25
Did you DAGS for an answer?

I DAGS for this and got lots of hit, some them describing similar issues. (Issue shows up on some machines but not on others.)

vba run-time error 429, activex component can't create object

It appears to be fairly common when trying to automate Access, jetreports, Excel VBA, etc. Registry entries seem to be mentioned quite often.

How To Post Data or Code ---> Click Here Before Posting Data or VBA Code


Reply ↓  Report •

#7
October 24, 2018 at 18:31:03
DerbyDad03, I don't know what DAGS is but if it is a search engine the answer is yes, I have tried a lot of recommended remedies, here is what I have tried so far:
repair office 2016
removing and reinstalling office 2016
installed vb6 service pack
installed vb runtime
a bunch of things I don't understand regarding early binding and reference libraries

the code works fine in 8 out of 10 machines that have the same version of office 2016 installed

message edited by mecerrato


Reply ↓  Report •

#8
October 24, 2018 at 19:19:50
The only other possibility that comes to mind is if the user accounts in question on the systems in question have never configured Outlook.

How To Ask Questions The Smart Way


Reply ↓  Report •

#9
October 24, 2018 at 19:34:25
That’s not it, both are fully functional with outlook.

Reply ↓  Report •

#10
October 24, 2018 at 19:59:09
DAGS - Do A Goggle Search


message edited by DerbyDad03


Reply ↓  Report •

#11
October 25, 2018 at 04:19:20
Well I feel like a total amateur, lol thanks. So yes I have DAG’d the issue to death with no solution.

Reply ↓  Report •

#12
October 26, 2018 at 05:01:54
✔ Best Answer
I was able to uncover the culprit of this issue and it had nothing to do with any of the recommended remedies. It was the antivirus policy that was blocking the macro script, not sure why yet and haven't been able to fix it permanently but a work around was to move the file to the c:\scripts folder that is excluded from the antivirus policy and it now runs perfectly. I am waiting on our corporate IT to figure the antivirus part out because I don't have access to investigate. I was able to find this through the windows event viewer that is where I saw that the macro script was being blocked. Hope this helps other folks that are on that same wild goose chase I was on.

Does anyone know how I can mark my this reply as the best answer for other folks to find?

message edited by mecerrato


Reply ↓  Report •

Ask Question