From: Simon Westenra on
I am getting "Error on loading DLL".
This occurs when I try to connect to Outlook.

I am using Access 97, and we have Outlook 2003 installed on this server.

I have added the reference to 'Microsoft Outlook 11.0 Object Library'. It
adds the reference without an error.

I have the following code.. (trimmed to the 2 relavent lines.)
Dim olApp As Outlook.Application
Set olApp = Outlook.Application '<- this gives the "Error in loading DLL"
message.
' Set olApp = CreateObject("Outlook.Application") ''tried this it also
failed

DEBUG-COMPILE compiles OK.

Reading through the various newsgroups I have tried
regsvr32.exe "C:\Program Files\Microsoft Office\Office11\msoutl.olb"

but this replies that "this is not a DLL or OCX file", so this fails.

Any ideas on what I can try now?
Thanks
Simon Westenra
Wellington, NZ
From: Douglas J. Steele on
You could try removing the reference completely, and then use Late Binding:

Dim olApp As Object

Set olApp = CreateObject("Outlook.Application")

The downside of this is that none of the Outlook constants will be available
to you: you'll have to either define them yourself, or use the numbers in
your code.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Simon Westenra" <simon.westenra(a)ccdhb..stopspam..org.nz> wrote in message
news:1AB35D01-C2E3-48CE-A5D1-D972493F916D(a)microsoft.com...
>I am getting "Error on loading DLL".
> This occurs when I try to connect to Outlook.
>
> I am using Access 97, and we have Outlook 2003 installed on this server.
>
> I have added the reference to 'Microsoft Outlook 11.0 Object Library'. It
> adds the reference without an error.
>
> I have the following code.. (trimmed to the 2 relavent lines.)
> Dim olApp As Outlook.Application
> Set olApp = Outlook.Application '<- this gives the "Error in loading DLL"
> message.
> ' Set olApp = CreateObject("Outlook.Application") ''tried this it also
> failed
>
> DEBUG-COMPILE compiles OK.
>
> Reading through the various newsgroups I have tried
> regsvr32.exe "C:\Program Files\Microsoft Office\Office11\msoutl.olb"
>
> but this replies that "this is not a DLL or OCX file", so this fails.
>
> Any ideas on what I can try now?
> Thanks
> Simon Westenra
> Wellington, NZ