Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open Outlook in Access 2003 problem

Posted on 2014-01-24
9
Medium Priority
?
374 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 53

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 2000 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

972 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