Solved

ActiveX component can't create object - Email thru Outlook

Posted on 2013-05-27
14
8,887 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
ID: 39199590
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
ID: 39199746
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]
ID: 39199822
Maybe this site helps, too:

http://support.microsoft.com/kb/319844/en-us
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 76

Expert Comment

by:David Lee
ID: 39201072
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
ID: 39201640
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
ID: 39201875
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
ID: 39201939
Windows 7 Prof / 64 bit
Office 2010 - 32 bit
Office 2003 - 32 bit

Isn't life suppose to be simpler :)
0
 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 50 total points
ID: 39202016
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
ID: 39202367
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
ID: 39202655
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
ID: 39202857
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
ID: 39202883
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
ID: 39203008
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
ID: 39204700
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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