That statement is unnecessary, since Outlook VBA supports a built-in Application object that you should be using instead, which is what your second version does.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"mlh" <mlh_hwh(remove this)@post9.tele.dk> wrote in message news:CF5B2F95-0FED-4FED-8CCF-(E-Mail Removed)...
> Hi I have run in to the following problem, that took som time debugging:
>
> if I write this
>
> Dim olApp As Outlook.Application
>
> Set olApp = CreateObject("Outlook.Application")
>
> In a macro in outlook 2003. (I copyed it from the builtin help).
>
> The macro runs fine, but when I later close outlook I get an Application
> failure reason: 0xc0000005. that I enterpret as VBA trying to ilegally acces
> memory.
>
> Altering to:
>
> Dim olApp As Outlook.Application
>
> Set olApp = Outlook.Application
>
> solves this problem.
>
>
>
>
>
> --
> Michael L. Holm