Automation error when trying to send email

J

John

Hi

I have ms access vba code that sends emails via outlook. The problem is that
the code previously working fine is now giving error on the following line
of code;

Set objOutlook = CreateObject("Outlook.Application")

The error is "Run-time error '-2147024770 (8007007e)': , Automation error,
The specified module could nor be found."

What is the problem and how can I fix it?

Thanks

Regards
 
S

Sue Mosher [MVP-Outlook]

If you get an error from code statements like these:

Dim ol as New Outlook.Application

Set ol = CreateObject("Outlook.Application")

the cause may be an anti-virus program on your computer that has a feature to block Outlook scripting. If so, the solution is to turn off the script blocking feature. You may need to contact technical support for your anti-virus program to find out how to do that.

I've also seen reports that setting the server parameter can resolve this problem in some situations:

Set ol = CreateObject("Outlook.Applicaton", localhost)
 
J

John

Hi Sue

Set objOutlook = CreateObject("Outlook.Application", "localhost") has fixed
it for me.

Many Thanks

Regards

If you get an error from code statements like these:

Dim ol as New Outlook.Application

Set ol = CreateObject("Outlook.Application")

the cause may be an anti-virus program on your computer that has a feature
to block Outlook scripting. If so, the solution is to turn off the script
blocking feature. You may need to contact technical support for your
anti-virus program to find out how to do that.

I've also seen reports that setting the server parameter can resolve this
problem in some situations:

Set ol = CreateObject("Outlook.Applicaton", localhost)
 

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