Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2007

Tip: Looking for answers? Try searching our database.

VBA runtime error 429: ActiveX component can't create object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manuel - 05 Nov 2007 19:58 GMT
I'm receiving the above error message when I instantiate Outlook in my VBA
code (I've pasted the code below).  I'm using Access 2003 on Windows XP.  The
code was working fine when I was running it on Window 2000 Professional
(still on Access 2003), but when I was upgraded to Windows XP recently, the
runtime error started occurring.  Does anyone have any idea how I can fix
this.

Function SendEmail(ByRef olTo As String, ByRef olCc As String, ByRef olBcc
As String, ByRef olSubj As String, ByRef acqid As String, ByRef Internal As
Boolean)
       On Error GoTo email_error
       Dim msg As String
       Dim path As String
       Dim path2 As String
       Dim appOutLook As Outlook.Application
       Dim MailOutLook As Outlook.MailItem
       '***THE CODE FAIL ON THE NEXT LINE***      
       Set appOutLook = CreateObject("Outlook.Application")
       Set MailOutLook = appOutLook.CreateItem(olMailItem)
         
         DoCmd.SetWarnings False
           
           With MailOutLook
           .BodyFormat = olFormatRichText
           .To = olTo
           .CC = olCc
           .Bcc = olBcc
           .Subject = olSubj
           Call getBodyMsg(msg, path, Internal, acqid)
               
           If acqid = "F" Then Exit Function
             
           .Body = msg
           .attachments.Add (path & acqid & ".xls")
           path2 = Left(path, Len(path) - 19) & "Database Files\"
           .attachments.Add (path2 & "Cover Sheet.xls")
           .display
           End With
           
           DoCmd.SetWarnings True
           Exit Function
email_error:
           MsgBox "An error has occured.  Please take a screen shot of this
error" & vbCrLf & _
           "and forward it to the system administrator." & vbCrLf & vbCrLf
& _
           "Error Number " & Err.Number & ": " & Err.Description,
vbCritical, "ERROR"
           Resume Error_out
Error_out:

End Function
pietlinden@hotmail.com - 06 Nov 2007 04:19 GMT
> I'm receiving the above error message when I instantiate Outlook in my VBA
> code (I've pasted the code below).  I'm using Access 2003 on Windows XP.  The
[quoted text clipped - 48 lines]
>
> End Function

you're mixing early and late binding.  If you use CreateObject, you
need to declare your variables as OBJECT, not as OUTLOOK... I think
there is an example on Access web... www.mvps.org/access  If not,
there are DOZENS here.  Look for CreateObject
Manuel - 06 Nov 2007 19:35 GMT
I tried your code but I'm still getting the error.  Out of curiosity, I tried
running the code (the one I wrote) on a colleagues machine, who's also using
Access 2003 on Windows XP, and did not encounter the error.  So, it seems to
be something related to my machine, not necessarily the code itself.  Is
there a library or DLL file that I need to register on my machine?  And if
so, which one?

> > I'm receiving the above error message when I instantiate Outlook in my VBA
> > code (I've pasted the code below).  I'm using Access 2003 on Windows XP.  The
[quoted text clipped - 53 lines]
> there is an example on Access web... www.mvps.org/access  If not,
> there are DOZENS here.  Look for CreateObject
Rick in NS - 31 Dec 2007 02:44 GMT
Manuel:

Did you every find out what registry entries are needed to get past this
problem?  I have the same issue and cannot find a solution.

Signature

Rick in NS

> I tried your code but I'm still getting the error.  Out of curiosity, I tried
> running the code (the one I wrote) on a colleagues machine, who's also using
[quoted text clipped - 60 lines]
> > there is an example on Access web... www.mvps.org/access  If not,
> > there are DOZENS here.  Look for CreateObject
Manuel - 31 Dec 2007 18:29 GMT
Rick:

No, I was never able to find a solution to the problem.  It's so strange
because the end user of the database I created is on the same OS (Windows XP)
and version of Access (2003), yet he doesn't get the error.  

I'm not even sure that it's a registry problem.  

I'll keep looking for an answer and if I find one I'll post it, but I've
been unsuccessful thus far.  If you find a solution, please post it or email
me directly at: manuel.soares@ihe.com.

Thanks!
Manuel

> Manuel:
>
[quoted text clipped - 65 lines]
> > > there is an example on Access web... www.mvps.org/access  If not,
> > > there are DOZENS here.  Look for CreateObject
Rick in NS - 31 Dec 2007 20:36 GMT
Manuel:

Thanks for the response.  Will likewise notify you if I ever solve the
problem.

Signature

Rick in NS

> Rick:
>
[quoted text clipped - 80 lines]
> > > > there is an example on Access web... www.mvps.org/access  If not,
> > > > there are DOZENS here.  Look for CreateObject
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.