471,874 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,874 software developers and data experts.

Create Object error after ugrading to Access 2003

I created an application in MS Access 2000. Since upgrading to MS
Access 2003 I have been finding all sorts of strange things. My current
problem is with the function below. Ig get an error "429 ActiveX
Componant Can't Create Object"
How can I correct this error?
Thanks very Much!
Here is the function:
' By Glen Appleton found in Google Group

'================================================= ======================

' Send an email message from Access in default or HTML format
'================================================= ======================

Public Function SendEmail(DisplayMsg As Boolean, _
SendTo As String, _
Subject As String, _
Body As String, _
Optional CCTo As String, _
Optional BCCTo As String, _
Optional AttachmentPath) As Boolean
On Error GoTo SendEmail_Err
' Use late binding to avoid Outlook library version compatibility

Dim objOutlook As Object ' Outlook application
Dim objOutlookMsg As Object ' Outlook message
Dim objOutlookRecip As Object ' Outlook recipients
Dim objOutlookAttach As Object ' Outlook attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Check session and exit if offline
'If objOutlook.Session.Offline Then GoTo EndSendMessage

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(0)

With objOutlookMsg
' Add the To recipient(s) to the message.
.To = SendTo

' Add the CC recipient(s) to the message.
If Not CCTo = "" Then .CC = CCTo

' Add the BCC recipient(s) to the message.
'If Not BCCTo = "" Then .BCC = BCCTo

' Set the Subject, Body, and Importance of the message.

.Subject = Subject

'If InStr(1, Body, "<html>", vbBinaryCompare) >= 1 Then
' .HTMLBody = Body & vbCrLf & vbCrLf
.Body = Body & vbCrLf & vbCrLf
' End If

.Importance = 2 'High importance

' Add attachments to the message.
'If Not IsMissing(AttachmentPath) Then
'*Set objOutlookAttach = .Attachments.Add(AttachmentPath)
'End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients

' Should we display the message before sending?
If DisplayMsg Then
' .Save
End If
End With


Set objOutlook = Nothing
Set objOutlookMsg = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
SendEmail = True
Exit Function
MsgBox "The e-mail has been canceled."
SendEmail = False
Exit Function

End Function

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
1 2026
' Use late binding to avoid Outlook library version compatibility

The above may be your problem, or part of your problem. I believe
Access2003 is stricter on stuff as far as


If you are using Outlook11 I think you need to add that to the
CreateObject statement. Also, I would use early binding instead of late
binding --- make sure you have a reference to the correct Outlook

Dim objOutlook As Outlook.Application

It is much better to generate version compatability problems at the
beginning of a project than farther down the road when you have already
developed stuff and late binding is just not going to forgive you any
longer for incompatability issues. Note: the less forgiving a system is
- the less undesired surprises you get down the road.


*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Susan Bricker | last post: by
9 posts views Thread by Marc Miller | last post: by
5 posts views Thread by Michael | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.