Can't start outlook from Excel

S

Susan Lammi

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")
 
B

Bob Phillips

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)
 
S

Susan Lammi

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
 
B

Bob Phillips

Doesn't that suggest that Outlook is not installed?

--

HTH

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

Susan Lammi

Obviously Outlook is installed because (as per my first post) I can open
it manually......
 

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

Top