Advertisement

06.03.2008 at 09:49AM PDT, ID: 23453797
[x]
Attachment Details

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

Asked by TrinaD71 in Microsoft Access Database, Access Coding/Macros, ActiveX

Tags: , , , , ,

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 SubStart Free Trial
[+][-]06.04.2008 at 05:14AM PDT, ID: 21709181

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 07:21AM PDT, ID: 21710369

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 10:25AM PDT, ID: 21712157

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 02:34PM PDT, ID: 21714321

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 02:53PM PDT, ID: 21714482

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 03:08PM PDT, ID: 21714595

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 04:03PM PDT, ID: 21714990

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 08:55AM PDT, ID: 21720973

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 09:32AM PDT, ID: 21721348

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 11:36AM PDT, ID: 21722590

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Access Coding/Macros, ActiveX
Tags: Microsoft, Access, 2000, SendEmail VBA Code, VBA, Error # 429: ActiveX component can't create object by db1
Sign Up Now!
Solution Provided By: puppydogbuddy
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.05.2008 at 11:43AM PDT, ID: 21722659

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 11:43AM PDT, ID: 21722661

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 11:57AM PDT, ID: 21722787

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 12:12PM PDT, ID: 21722926

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 12:21PM PDT, ID: 21723014

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 12:56PM PDT, ID: 21723324

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 06:48AM PDT, ID: 21846143

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 07:10AM PDT, ID: 21846358

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628