vba error run-time 429 activex component can't create object - excel & outlook 2007

dgr7

Board Regular
Joined
Apr 5, 2006
Messages
225
hello,
I have some VBA code that in one portion of it an Outlook e-mail is created and the active workbook is attached and sent. This code used to work on Excel & Outlook 2003, but now in Excel & Outlook 2007 I'm getting the error:

Run-time error '429':
ActiveX component can't create object

and is stopping on the line

Set OutApp = GetObject(, "Outlook.Application")

FY If I comment out the Set OutApp... and If OutApp.... lines and uncomment the Set OutApp create object line, I still get the same error.

How do I fix this run-time error so the code will successfully run?
thanks in advance,
david

Code:
 Dim OutApp As Object
    Dim OutMail As Object
    Dim SigString As String
    Dim Signature As String

    'Set OutApp = CreateObject("Outlook.Application")
    Set OutApp = GetObject(, "Outlook.Application")
    If OutApp Is Nothing Then Set OutApp = CreateObject("Outlook.Application")
    
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)



    On Error Resume Next
    With OutMail
        .To = "test@test.com"
        .BCC = ""
        .Subject = ActiveWorkbook.Name
        .HTMLBody = "Please see the_attached workbook " & ActiveWorkbook.Name & ".<br><br>" & Signature
        .Attachments.Add ActiveWorkbook.FullName
        .Display
        '.Send
    End With

    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
 
Glad to help. I suspect there may be something awry in your registry for the CreateObject method not to work.
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Dim app as new outlook.application
dim msg as outlook.mailitem
set msg = app.createobject(olmailitem)

i am getting error message on the msg
Runtime error 429
Kindly help me
 
Upvote 0
Thanks for the great reply. I had the same problem with office 2010 and this answer worked a treat
 
Upvote 0
Sorry to bump a really old thread.

But I have rolled out something small to a bunch of different users, the code is run from within Outlook.

On only one such user the code:

Code:
Set objOut = CreateObject("Outlook.Application")

Did not work, after researching the cause, I have checked all the .dll files, the registry etc.

But the fix in this thread worked, replacing the above with:

Code:
Set objOut = New Outlook.Application

This is great, I'm just wondering if anyone knows why? Why just one computer out of the 8 I put this on, when all the references/dll's etc match the other machines?

Thanks
 
Upvote 0
If you set a reference to the Outlook 2007 library in your Excel projectand use code like:
Code:
Dim OutApp as Outlook.Application
Set OutApp = New Outlook.Application
do you get the same error?

I know this is a very old thread, but just wanted to share my thanks! After years of using Set object = CreateObject I started experiencing this same error. I changed it to Set Object = New and the issue was resolved.
 
Upvote 0
Hi all, I agree this post is old but I discovered another problem:
Even with late binding I can't seem to address Outlook 2013 from within Access 2003.
From what I've seen it seems something changed around 2007 or 2010 which means you can no longer call Outlook from within A2003
I can still call Outlook 2003 but not the rest :(
 
Upvote 0

Forum statistics

Threads
1,223,574
Messages
6,173,144
Members
452,501
Latest member
musallam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top