Application failure in outlook 2003 following VBA macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

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

Back
Top