Solved

Open Outlook in Access 2003 problem

Posted on 2014-01-24
9
363 Views
Last Modified: 2014-01-26
Hi EE

I am converting access reports into PDF file format then opening in outlook with the PDF file as an attachment. It has been working fine but now I am getting an error when opening Outlook

ActiveX component can't create object.        

and the line highlighted  is

ErrorHandler:
   'Outlook is not running; open Outlook with CreateObject
   If err.Number = 429 Then
      Set olLook = CreateObject("Outlook.Application")                   (Highlighted)
      bin_quitoutlook = True
      Resume Next
   Else
      MsgBox "Error No: " & err.Number _
         & "; Description: " & err.Description
      Resume ErrorHandlerExit
   End If

What should I look for to fix this problem.

Alan
0
Comment
Question by:chestera
9 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39808529
Hi,

Is the reference to Outlook missing

refer to

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

Regards
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39809059
I have encountered that problem many times at customer's sites, and could usually solve the problem through one of the 3 following ways:

1. Call createobject("outlook.application","localhost")

2. Removing anti-virus add-ins in Outlook, or deactivating either a specific Outlook option or a more general Office option in the anti-virus configuration. This naturally is different from one anti-virus to another.

3. Repairing Office installation from the Control Panel, but in a few instances, this was not enough. Uninstalling and reinstalling Office solved the problem. You might want to use the Save My Settings wizard in the Office menu Under Start before doing so. This will enable you to bring back most of the user custom settings after the reinstall.
0
 

Author Comment

by:chestera
ID: 39809179
JamesBurger

Thank you James I will get back to you. Although I have the reverse working ok on the users PC but not my PC.

Alan
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:chestera
ID: 39809185
Rgonzo1971

Thank you for your help. I have looked at the references and Outlook is solid. I am going to check James suggestions.

Alan
0
 

Author Comment

by:chestera
ID: 39809189
JamesBurger

It's a public holiday over here today and I have family commitments so there could be a delay with my reply

Alan
0
 
LVL 84
ID: 39809927
Is the reference to Outlook missing
You don't need a reference if you're using CreateObject, unless you're using other bits needed by that reference. Without seeing the full code block it's impossible to determine if the actual reference is needed.

chestera: You can determine if you actually need the Outlook Reference by doing this:

1. Compile your code. From the VBA Editor window click Debug - Compile. Fix any errors you find, and continue doing this until that menuitem is disabled.
2. Now remove the reference - click Tools - References and clear the checkbox next to the Outlook reference.
3. Now compile your code again. If the compile completes, you don't need that reference.

One of the main reasons for using Late Binding is to remove the need to have specific references in the database. With CreateObject (i.e. Late Binding), you are essentially telling VBA To "use whatever version of Outlook you find on the machine".

It's also possible that you have some corruption starting up in your database. You should make a copy of your database, then do this:

1. Compact your database
2. Compile your code (see above)
3. Compact again

Sometimes it helps to "decompile" your code. To do that, create a shortcut with this as the target:

"full path to msaccess.exe" "full path to your database" /decompile

Run that shortcut, then do the 3 steps again.

In addition to what James Burger suggests, you should also insure that your Windows installation is fully up to date.
0
 

Author Comment

by:chestera
ID: 39810553
jamesburger

Hi James

Sorry for the delay.
Tried the createobject("outlook.application",localhost") got the message "Class not registered on local machine. So my next move was to re-install office inserted the disk and got the option to Add, Remove or Repair so I chose Repair. The Repair fixed the problem. So thank you for that advise

Alan
0
 

Author Comment

by:chestera
ID: 39810560
Scott Mcdaniel

Thank you for that info. I did decompile the dB it's the first thing I usually do. I made sure windows was up to date although I have had problems after a windows update rare but it can happen. As I told James I repaired Office and it fixed the problem. James was the first cab off the rank so I will give him the points

Many thanks

Alan
0
 

Author Closing Comment

by:chestera
ID: 39810563
Thank you James
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

831 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