+ Reply to Thread
Results 1 to 5 of 5

Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel info

Hybrid View

  1. #1
    Registered User
    Join Date
    10-01-2020
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Office 365
    Posts
    2

    Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel info

    Hello everyone.
    I am getting an error when running the Macro below on a Mac.
    Debugger highlights section Set OutApp = CreateObject("Outlook.Application")
    Would appreciate some guidance as to what should be done for this Macro to work on a Mac. Thank you.

    Complete macro code follows:


    Sub CXR()
    
    ActiveSheet.Unprotect Password:=""
    
    ' Don't forget to copy the function RangetoHTML in the module.
    ' Working in Office 2000-2010
        Dim rng As Range
        Dim OutApp As Object
        Dim OutMail As Object
     
        With Application
            .EnableEvents = False
            .ScreenUpdating = False
        End With
     
        Set rng = Nothing
        On Error Resume Next
        Set rng = ActiveSheet.Range("CXR_Range").SpecialCells(xlCellTypeVisible)
        On Error GoTo 0
     
        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
     
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
     
        On Error Resume Next
        With OutMail
            .To = ActiveSheet.Range("B9").Value
            .Cc = ActiveSheet.Range("B10").Value
            .BCC = ""
            .Subject = ActiveSheet.Range("B11").Value
            .HTMLBody = RangetoHTML(rng)
            .Display   'or use .Send
        End With
        On Error GoTo 0
     
        With Application
            .EnableEvents = True
            .ScreenUpdating = True
        End With
     
        Set OutMail = Nothing
        Set OutApp = Nothing
    
    ActiveSheet.Protect Password:=""
    
    End Sub
    Last edited by davesexcel; 10-01-2020 at 04:20 AM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel

    You need to set a reference to Microsoft Outlook xx.x Object Library, where xx.x represents the version of Outlook that you are working with...

    Untitled.png



    To overcome this I prefer to make use of...
    Replace this...
    With OutMail
    With...
    With CreateObject("Outlook.Application").CreateItem(0)
    and remove all this...
    Dim OutApp As Object
    Dim OutMail As Object
     
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    
    Set OutMail = Nothing
    Set OutApp = Nothing
    Last edited by Sintek; 10-01-2020 at 04:34 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    10-01-2020
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel

    Hello Sintek and everyone,
    Thanks for your support!

    Your reply did help (no error message) but instead of opening an Email, it opened a new Excel workbook and included the content I was expecting to get loaded onto an Email. I have checked the References, and I don't have a Microsoft Outlook Object Library available. Is there another workaround to this?

    Thank you!

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel

    Then your code is not doing what you expect it to do...Incorrect code use...
    I suggest uploading a sample file and explaining in detail what you want to achieve...See Top Yellow banner...

    Where is the code for this function...
    RangetoHTML

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Run-time-error '429': ActiveX component can't create object --> Create Email w/ Excel

    Since you appear to be using some of Ron's code already, you should read the Mac parts of his site, especially: http://www.rondebruin.nl/mac/macmail/macoutlook2016.htm
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. For the Mac Run-time error 429 ActiveX component can't create object
    By Jsalisbury in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2021, 04:56 AM
  2. Run-time Error '429': ActiveX Component Can't Create Object
    By Ganesh7299 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-17-2015, 04:04 PM
  3. VBA Excel : Run time error '429': ActiveX component can't create object
    By devendravitm in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-20-2013, 02:07 PM
  4. Run-time error '429' ActiveX component can't create object
    By gamaz in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-29-2012, 10:24 PM
  5. [SOLVED] Run-time-error '429': ActiveX component can't create object
    By Lloyd Blankfein in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-28-2012, 07:21 PM
  6. Run Time error 429 (ActiveX component can't create object)
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2012, 03:08 PM
  7. Run-time error ‘429’ ActiveX component can’t create object
    By AliJay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2012, 05:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1