Solved

Open Outlook in Access 2003 problem

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

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

895 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

14 Experts available now in Live!

Get 1:1 Help Now