Problem automating outlook

J

John

Hi

I am using the following code to automate outlook from within MS Access;

Dim O As Object
O = CreateObject("Outlook.Application")

The problem is that I am getting the following error on the second line;

Automation error
The specified module can not be found

What is the problem and how can I fix it?

Thanks

Regards
 
D

Dirk Goldgar

John said:
Hi

I am using the following code to automate outlook from within MS
Access;

Dim O As Object
O = CreateObject("Outlook.Application")

The problem is that I am getting the following error on the second
line;

Automation error
The specified module can not be found

What is the problem and how can I fix it?

Are you sure that's your exact code , the exact error message you're
getting, and the exact line that's raising the error? That code should
fail with error 91, "Object variable or With block variable not set",
because you don't use the Set statement. It should be

Set O = CreateObject("Outlook.Application")

That works fine for me. Is Outlook correctly installed on the PC where
you're running this?
 
D

Dirk Goldgar

John said:
I am now using;

Set O = CreateObject("Outlook.Application")

and I am getting the attached error. Outlook 2003 seems to be working
fine otherwise. I have also done a detect and repair on it.

I just searched Google Groups for the error message you reported. In
another thread, Sue Mosher (Outlook MVP) suggests an antivirus program
may be to blame:

==== quote ====
AVG is probably the culprit. I bet it has a script blocker that's
blocking the CreateObject("Outlook.Application") call.

FYI, there is a newsgroup specifically for general Outlook programming
issues "down the hall" at microsoft.public.outlook.program_vba or, via
web interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

==== end quote ====

That thread may be found at

http://groups.google.com/group/micr...read/thread/cb73aab079789b2d/fcdbf7ef687881db

Does Sue's theory make any sense?
 
J

John

Apparently using

Set objOutlook = CreateObject("Outlook.Application","localhost")

fixes the problem. Not sure why though.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top