M
Manuel
Hi,
I have a VBA procedure which sends an email. This procedure was running
fine when I was on Windows Professional 2000. Last week I was upgrade to
Windows XP, and now when I run the code I get the following error message:
VBA Error #429: ActiveX component can't create object
I’ve confirmed that I have the Microsoft Outlook 11.0 Object Library
registered.
When I run the code on another computer operating on Windows Professional
2000, I do not receive this error.
The code is below:
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
'***Procedure fails at the preceeding step***
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)
.Body = msg
.attachments.Add (path & Acqid & ".xls")
path2 = Left(path, Len(path) - 19) & "Database Files\"
.attachments.Add (path2 & "Cover Sheet.xls")
.Send
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
****
Does anyone know how I would go about curing this error?
Thanks in advance for your assistance.
Manuel
I have a VBA procedure which sends an email. This procedure was running
fine when I was on Windows Professional 2000. Last week I was upgrade to
Windows XP, and now when I run the code I get the following error message:
VBA Error #429: ActiveX component can't create object
I’ve confirmed that I have the Microsoft Outlook 11.0 Object Library
registered.
When I run the code on another computer operating on Windows Professional
2000, I do not receive this error.
The code is below:
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
'***Procedure fails at the preceeding step***
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)
.Body = msg
.attachments.Add (path & Acqid & ".xls")
path2 = Left(path, Len(path) - 19) & "Database Files\"
.attachments.Add (path2 & "Cover Sheet.xls")
.Send
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
****
Does anyone know how I would go about curing this error?
Thanks in advance for your assistance.
Manuel