Solved

Open Outlook in Access 2003 problem

Posted on 2014-01-24
9
356 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 48

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
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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.
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.

707 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

13 Experts available now in Live!

Get 1:1 Help Now