Automating Outlook (A2003) -- resolved!

D

David W. Fenton

Well, I started this post to ask if anybody had a fix for a recent
problem I encountered, but in writing it up I did some more Googling
and have solved it. I thought I'd post about it anyway, since it is
a confusing one to encounter, and the cause is difficult to
identify. Also, it is resolved with a parameter I didn't know
existed before. Anyway, first the description of the problem:

I have a client app that automates Outlook to send email with
attachments using Outlook Redemption. It's still working fine for
the client, but on my computer, any attempt to initialize an Outlook
instance for automation results in this error:

-2147024770: Automation error
The specified module could not be found.

At first I thought this was a firewall/security software issue, as
I've recently removed AVG (because it was eating up too many CPU
cycles and issuing misleading "you need to upgrade" advisories) and
started using MS's Security Essentials. But if I set to it to allow
Outlook and Access, or turned it off completely, the error still
happened.

The result seems to me in providing a hostname to the CreateObject
command:

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

I was not supplying that because I didn't even know that paremeter
existed. I believe I'm going to make it a habit of using it in all
cases whenever I use CreateObject. The reason I suspect it's helpful
is that the article that gave me the answer:

http://tinyurl.com/27na859 =>
http://www.generation-nt.com/us/answer/createobject-outlook-applicati
on-causes-an-error-2147024770-help-40108282.html

....specified that the problem was caused by AV software (which is
what I suspected in my own case, since the only difference on my PC
since this last worked was the switch from AVG antivirus-only to
Microsoft Security Essentials).

I can see why security software would consider a command that
doesn't specify a target server as suspect, but it does seem
overkill to block it when the default when nothing is specified is
to use 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