Solved

ActiveX component can't create object - Email thru Outlook

Posted on 2013-05-27
14
7,683 Views
Last Modified: 2013-05-29
Problem
I get the error "ActiveX component can't create object" on the 2nd line of code in Access 2003.  Same database (mdb) opened in Access 2010 it works without problems.
            Dim objOutLkApp As Object
            Set objOutLkApp = CreateObject("Outlook.Application")

Some Facts
    1) Use the same code all the time for my customers with Access 2003 & Outlook 2003
    2) I was adding email capability to an app and discovered the error on my machine.
    3) I have installed Office 2010 but kept Access 2003
    4) I have no missing references and I do not reference Outlook reference library -  I like using late binding on purpose.

    5) I've tried referencing Microsoft Outlook 14.0 Object Library with the following code, but got the same error (Early Binding).
               Dim objOutLkApp As Outlook.Application        
               Set objOutLkApp = New Outlook.Application

    6) Telling my customers to upgrade to 2010 is not an option    

Any Thoughts?
Thanks for any help
LJG
0
Comment
Question by:LJG
  • 5
  • 3
  • 3
  • +2
14 Comments
 
LVL 20

Expert Comment

by:GrahamMandeno
Comment Utility
There should be no problem automating Outlook 2010 from Access 2003 - I have done this in dozens of applications myself.

Does the problem occur on more than one computer?  Usually such a problem is due to a missing or damaged component, or a fault in the registration of the automation server on a single computer.  This can be fixed by repairing the installation.

First make sure that all Office apps are closed, then go to Programs and Features in the Control Panel and find Microsoft Office 2010.  Right-click on it and click Change.  Select Repair and click Continue.

With luck, when the procedure completes your problem should be solved.

Best wishes,
Graham Mandeno [Access MVP 1996-2013]
0
 
LVL 47

Expert Comment

by:apache09
Comment Utility
Is this code creating or opening an email?

If it is, its possible the mapi dlls that allow the MAPIMail Service to run are broken or corrupt.

Could look at renaming/recreating the mapi dlls
http://www.ctimls.com/support/kb/error%20fixes/fix_mapi_error.htm

This usualyl fixes issues sending mail from other apps
0
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
Comment Utility
Maybe this site helps, too:

http://support.microsoft.com/kb/319844/en-us
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
LJG,

As a test, how about trying to create an instance of Word or Excel instead of Outlook?  The point of the test would be to see if the problem is with Outlook or with any of the Office 2010 apps.
0
 
LVL 2

Author Comment

by:LJG
Comment Utility
Lots of good ideas - Just not an answer yet.  Any other ideas?

GrahamMandeno
1) It does work with no problems on my laptop (both Access 2003 & 2010) so we know it's something with my desktop.

2) From the Control Panel I repaired Office 2010 / shut down my computer-restarted / Still the same problem.

BlueDevilFan
                  Dim objOutLkApp As Object  
                  Set objOutLkApp = CreateObject("Outlook.Application")
                  Set objOutLkApp = Nothing

------------------------ All the below work in 2010
      Set objOutLkApp = CreateObject("Outlook.Application") <--- Outlook does not work in 2003
      Set objOutLkApp = CreateObject("Word.Application") <--- This Works  in 2003
      Set objOutLkApp = CreateObject("Excel.Application") <--- This Works  in 2003

Other folks - thanks for the links but neither helped.

Any other ideas at this point???

Thanks for all your thoughts.
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
So it's just Outlook that doesn't work.  That's bizarre.  What version of Windows is on the computer and is it 32 or 64 bit?  Is Access 2003 32 or 64 bit?  How about Office 2010?
0
 
LVL 2

Author Comment

by:LJG
Comment Utility
Windows 7 Prof / 64 bit
Office 2010 - 32 bit
Office 2003 - 32 bit

Isn't life suppose to be simpler :)
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 50 total points
Comment Utility
Have you tried
 Set objOutLkApp = CreateObject("Outlook.Application.??")
where ?? might be 11 or 12 or whatever, since you have installed Office "twice"?!
... just a thought...
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 150 total points
Comment Utility
Purely as a test, how about creating a new database and try creating an instance of Outlook from it?  The point of this test is to determine if there's something wrong with the database you're using now.
0
 
LVL 2

Author Comment

by:LJG
Comment Utility
Thanks again for the responses.

------------------------ All the below work in 2010
      Set objOutLkApp = CreateObject("Outlook.Application.14") <--- Outlook does not work in 2003
      Set objOutLkApp = CreateObject("Word.Application".14) <--- This Works  in 2003
      Set objOutLkApp = CreateObject("Excel.Application.14") <--- This Works  in 2003

----- In case you want to ask ------------------- Does Not work in 2003 or 2010 ----
      Set objOutLkApp = CreateObject("Outlook.Application.11")

----------------------------
Yes = I've tried it in 3 different 2003 databases.

thanks!
0
 
LVL 20

Accepted Solution

by:
GrahamMandeno earned 300 total points
Comment Utility
Hi LJG

Are you absolutely sure you have only one version of Outlook installed?  Outlook does not take kindly to multiple versions.

Just to confirm the problem is definitely in Outlook 2010, open Word 2010 and press Alt-F11 to open the VBA window.  In the Immediate pane, type:
?CreateObject("Outlook.Application").Version

It should respond with 14.0.0.6126 or something similar.

If it fails and gives an error then Outlook is definitely broken.  

In this case I suggest you cut your losses and completely uninstall Office 2012 and reinstall it.  There are all sorts of things you can check like registry keys and versions of DLLs, but if the installation repair failed to fix the problem then it will be very difficult to find it manually.

One other thing you could try before uninstalling is to disable all Outlook add-ins: Outlook File button | Options | Add-Ins | Manage: COM Add-Ins | Go... | then uncheck all the items. If this solves the problem, then re-enable one add-in at a time until the problem reappears.

Good luck!
Graham
0
 
LVL 2

Author Comment

by:LJG
Comment Utility
Graham
Thanks so much - I have the version below, but I can't do the Com Addins until tomorrow sometime.

?CreateObject("Outlook.Application").Version
14.0.0.6131

Thanks
LJG
0
 
LVL 20

Expert Comment

by:GrahamMandeno
Comment Utility
Hmmm...

The fact that ?CreateObject("Outlook.Application").Version returns any result at all suggests that the problem is NOT with Outlook 2010, and is therefore in Access 2003.

I suggest you move your focus back to Access 2003 and try a Detect and Repair (from the Help menu).

These interoperability problems really can be pigs to solve!

Cheers,
Graham
0
 
LVL 2

Author Closing Comment

by:LJG
Comment Utility
Thanks for all the work EVERYONE did for me.

I've taken out all the Outlook Add-ins - shutdown the computer - did not solve the problem.


Sometime in the next two weeks, I'll re-install Office 2010.  If that works I'll come back an let everyone know

Go have some fun today - LJG
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Set OWA language and time zone in Exchange for individuals, all users or per database.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now