Solved

Open Outlook in Access 2003 problem

Posted on 2014-01-24
9
368 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 52

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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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 85
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

615 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