Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX component can't create object

Status
Not open for further replies.

MDJ52

MIS
Mar 30, 2001
120
US
I am running Access 2000 along with Office 2003 for all other office modules.
I have just rebuilt my machine, loading office 2003 basic 1st and then Access 2000.
I wrote a module to create an email from information in Access databases. This code has worked fine on a number of other systems with the same configuration. It worked fine on mine until I rebuilt the system. By the way it is XP Pro.
Here is the code:

Function CreateEmail() As Variant
Dim mydb As DAO.Database
Dim my1 As DAO.Recordset
Dim emailhold As String
Dim emailcc As String
Dim errhold As String
Dim Subject As Variant
Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim objOutlookRecip As Object
Dim objOutlookAttach As Object
Dim rfqhold As String
Dim delayend As Double
Dim messageh As String
Set mydb = CurrentDb
Set my1 = mydb.OpenRecordset("custrfq_sel_email")

'Create the outlook session
Set objOutlook = CreateObject("Outlook.Application")
'Create the message
Set objOutlookMsg = objOutlook.CreateItem(0)

When I get to the createobject statement I get the error:
Runtime error 429
Activex component can't create object.

I have search Microsoft and the forums, but find nothing with this conbination for a configuration.

References within the code are:
VB for Applications
Access 9.0
Outlook 11.0
OLE Automation
DAO 3.6
Forms 2.0
Scripting Runtime
ActiveX Dataobjects 2.5
Any help would be appreciated

 
Which line is the error on?

Ignorance of certain subjects is a great part of wisdom
 
The error is showing in the debug on:

Set objOutlook = CreateObject("Outlook.Application")
 
Have you tried declaring objOutlook as Outlook.Application rather than object?

I would try that or late binding (declare objOutlook like so: Dim objOutlook) first

Hope this helps

Ignorance of certain subjects is a great part of wisdom
 
Yes, I tried that as an option.
Once it gets to the SET line, I get the same error.
 
Did you try late binding as well?

Ignorance of certain subjects is a great part of wisdom
 
From what I understand, late binding is setting the DIM statement to object rather than outlook.application.
I have tried both ways.
In researching the Microsoft site over lunch I found a method that makes the application explicit.
In the statement CreateObject("Outlook.Application"), I change it to CreateObject("Outlook.Application.11").
This worked and I was able to send the email.
All I can guess is it is because I have Office 2003 with Access 2000.
The only problem I see now is I will have to watch the systems I put it on to be sure we are all on the same version.
On my past system I had Outlook 2002 and Access 2000 and it worked fine.
I quess I still do not know, but for now I have a work around, but I would love to get it back to a generic version where it does not matter what version of Outlook I have on the PC.
 
We use Office 2003 and Access 97. The only thing that I can notice is we have a reference to Micorsoft Office that you don't seem to have set. Out create statement was ("Outlook.Application") without the version number.
 
What is the specific reference for Microsoft Office?
I would like to be able to take off the '.11', but right now it seems to be the only way to make it work.
 
look for "Microsoft Office 11.0 Object Library" the file name is MSO.DLL. Each version of Office has its own version of this DLL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top