Outlook automation

Malcy

Registered User.
Local time
Today, 23:36
Joined
Mar 25, 2003
Messages
584
Hi
Getting an odd one here that I think may be network/security based rather than VBA but would like to check first.
I have a bit of Outlook automation code that I have re-used from a previous application. It worked fine there, and it works fine in the new app from my office but when I tried it at the clien't I got an "Automation error - The specified module could not be found"
The line the code is failing on is
Code:
' Create the Outlook session.
                Set objOutlook = CreateObject("Outlook.Application")
objOutlook is dimensioned as Outlook.Application at the start.

Two questions I suppose, why might it work in my office and not my client's - both Access 2003 running on XP Pro with Small Business Server (but I do not manage their server so there may be other issues). Secondly might it be better to introduce a new line above the Set objOutlook line to read
Set objOutlook = New Outlook.Application
or would that simply be redundant?

If anyone can point me that would be wonderful
Thanks and best wishes
 
Is there a reference set to the Outlook Library? I would either use on the the below


Dim objOutlook as object

Or

Dim objOutlook as New Outlook.Application

If you use the second of the two you won't need use the CreateObject function.
 
Thanks
Yes the reference to Outlook is OK - first thing I checked
I will try adding New to the dim statement. It is a pain since I cannot really test it till I get back into the client! Still I suppose if I have it working seamlessly here it has to work there!!!
 

Users who are viewing this thread

Back
Top Bottom