View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Susan Lammi[_2_] Susan Lammi[_2_] is offline
external usenet poster
 
Posts: 3
Default Can't start outlook from Excel

Sorry but No, I already looked there and outlook is not starting......
The application error I get "The instruction at 0x309ad857 referenced
memory at 0x00000000. The
memory could not be read.

translates to VBA error 429.

Checking the help files suggests that automation can't find the license
key or some such thing....

thanks anyway
"Bob Phillips" wrote in message
...
Susan,

I think you will find that you have started Outlook, you just haven't

made
it visible. Step through your code again and look at the Processes tab

in
the Windows Task Manager, you should see an OUTLOOK.EXE in there.

Unfortunately, Outlook doesn't have a Visible property like Word or

Excel,
so we have to be smarter. What we need to do is open one of the special
folders, such as the Inbox. Try this code

Dim ol As Outlook.Application
Dim olNameSpace As Outlook.NameSpace
Dim olInbox As Outlook.MAPIFolder

Set ol = New Outlook.Application

Set olNameSpace = ol.GetNamespace("MAPI")

Set olInbox = olNameSpace.GetDefaultFolder(olFolderInbox)

'Make Outlook visible
olInbox.Display


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Susan Lammi" wrote in message
...
I am unable to start Outlook from Excel (VBA) using either of the
following. I would prefer early binding but will take either....

Both of the set commands results in an Application error
"The instruction at 0x309ad857 referenced memory at 0x00000000.

The
memory could not be read.

If I open Outlook manually then either one of the set commands will

work
properly.

Excel has the appropriate reference set.

Can someone shed some light on this problem...... Thanks
Set ol = New Outlook.Application
Set myolapp = CreateObject("Outlook.Application")