Question : Error # 429:  ActiveX component can't create object by db1 when sending automatic email

I have an Access database that will send an email when the user clicks a command button.  The functionality worked fine on one computer yesterday but is not working on another today.  

The error occurs on the following code:
    Set objOutlook = CreateObject("Outlook.Application")

I have the following references set:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft Outlook 11.0 Object Library
Microsoft DAO 3.6 Object Library

The full code for the email function that is failing is:
Public Sub NotifyEmail(strEMailRecipient, strReport, strSubject, strBody)
 'This function will send an email with a report
 'attachment when a user elects.
   
   'Dim objOutlook As Outlook.Application
   'Dim objOutlookMsg As Outlook.MailItem
   'Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   
   Dim objOutlook As Object
   Dim objOutlookMsg As Object
   Dim strCurrentUser As String
   
   Set objOutlook = CreateObject("Outlook.Application")
   Set objOutlookMsg = objOutlook.CreateItem(0)
   strCurrentUser = CurrentUser()
     
 On Error GoTo CancelEmail
 
    DoCmd.SendObject objecttype:=acSendReport, _
    objectname:=strReport, _
    outputformat:=acFormatRTF, _
    To:=strEMailRecipient, _
    Subject:=strSubject, _
    messagetext:=strBody
   

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

     
GoTo ErrorHandler
       
CancelEmail:
 ' MsgBox "The transaction was cancelled.  "
 MsgBox "Error #" & Err.Number & ": " & Err.Description & " by " & Err.Source, vbOKOnly, "Error in procedure Form_Open of frmSelectUsers"
CancelEmailExit:
  Exit Sub
 
ErrorHandler:
  MsgBox "The report was emailed to " & strEMailRecipient & " successfully ."
     
ErrorHandlerExit:
   Exit Sub
 
End Sub

Answer : Error # 429:  ActiveX component can't create object by db1 when sending automatic email

This problem could be tricky to resolve,,,,,,,the error 429 is a cryptic error message that could occur from a number of sources and have nothing to do with an ActiveX  at all.  See this link for troubleshooting Error 429 arising from the use of automation objects.  Maybe you'll notice something related to your operating environment

http://support.microsoft.com/kb/244264
Random Solutions  
 
programming4us programming4us