Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
lee lee is offline
external usenet poster
 
Posts: 184
Default Why does Outlook.Application.GetNamespace("MAPI") Fail?

Can anyone point me in the direction as to why the following fails?

Set NS = Outlook.Application.GetNamespace("MAPI")

It is done on a server that only has outlook and exel installed (Excel is
the full instlal, outlook is only partially).
--
-Lee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Why does Outlook.Application.GetNamespace("MAPI") Fail?

Hi Lee,
I believe the MAPI namespace only works if Outlook is configured for
CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the other
option is). Also, the MAPI namespace is a connection to an MS Exchange
Server, so a "partial" install of Outlook may not be enough to allow you to
use the MAPI namespace. Another possible cause of the problem: trying to get
to the namespace without an instance of the Outlook Application object. Try
this instead:

set myOutApp = GetObject("Outlook.Application")
set NS = myOutApp.GetNamespace("MAPI")

Using GetObject will allow you to use an existing instance of Outlook, if
there is one; otherwise it will create a new instance. If you prefer to
create a new instance anyway, change the first line to:
set myOutApp = new Outlook.Application

Hope this helps!

Shadhi

"Lee" wrote:

Can anyone point me in the direction as to why the following fails?

Set NS = Outlook.Application.GetNamespace("MAPI")

It is done on a server that only has outlook and exel installed (Excel is
the full instlal, outlook is only partially).
--
-Lee

  #3   Report Post  
Posted to microsoft.public.excel.programming
lee lee is offline
external usenet poster
 
Posts: 184
Default Why does Outlook.Application.GetNamespace("MAPI") Fail?

Okay, I found the problem. It is saying I am missing a .dll file. Does
anyone know what the .dll file I would need for this, its really Excel
running an outlook method. Thanks.
--
-Lee


"Shadhi" wrote:

Hi Lee,
I believe the MAPI namespace only works if Outlook is configured for
CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the other
option is). Also, the MAPI namespace is a connection to an MS Exchange
Server, so a "partial" install of Outlook may not be enough to allow you to
use the MAPI namespace. Another possible cause of the problem: trying to get
to the namespace without an instance of the Outlook Application object. Try
this instead:

set myOutApp = GetObject("Outlook.Application")
set NS = myOutApp.GetNamespace("MAPI")

Using GetObject will allow you to use an existing instance of Outlook, if
there is one; otherwise it will create a new instance. If you prefer to
create a new instance anyway, change the first line to:
set myOutApp = new Outlook.Application

Hope this helps!

Shadhi

"Lee" wrote:

Can anyone point me in the direction as to why the following fails?

Set NS = Outlook.Application.GetNamespace("MAPI")

It is done on a server that only has outlook and exel installed (Excel is
the full instlal, outlook is only partially).
--
-Lee

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Why does Outlook.Application.GetNamespace("MAPI") Fail?

Why not try an Outlook group. You have departed from any dependence on
Excel.

--
Regards,
Tom Ogilvy


"Lee" wrote in message
...
Okay, I found the problem. It is saying I am missing a .dll file. Does
anyone know what the .dll file I would need for this, its really Excel
running an outlook method. Thanks.
--
-Lee


"Shadhi" wrote:

Hi Lee,
I believe the MAPI namespace only works if Outlook is configured

for
CIW (Corporate Intranet/Workgroup?), not Internet Mail (or whatever the

other
option is). Also, the MAPI namespace is a connection to an MS Exchange
Server, so a "partial" install of Outlook may not be enough to allow you

to
use the MAPI namespace. Another possible cause of the problem: trying

to get
to the namespace without an instance of the Outlook Application object.

Try
this instead:

set myOutApp = GetObject("Outlook.Application")
set NS = myOutApp.GetNamespace("MAPI")

Using GetObject will allow you to use an existing instance of Outlook,

if
there is one; otherwise it will create a new instance. If you prefer to
create a new instance anyway, change the first line to:
set myOutApp = new Outlook.Application

Hope this helps!

Shadhi

"Lee" wrote:

Can anyone point me in the direction as to why the following fails?

Set NS = Outlook.Application.GetNamespace("MAPI")

It is done on a server that only has outlook and exel installed (Excel

is
the full instlal, outlook is only partially).
--
-Lee



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Why does Outlook.Application.GetNamespace("MAPI") Fail?

Set NS = Application.GetObject("Outlook.Application").GetNa mespace("MAPI")

Would be more what your are looking for. This would require Outlook to be
running at the time.

If it isn't running, use CreateObject instead. See VBA help on GetObject
and CreateObject for examples and explanations.

--
Regards,
Tom Ogilvy

"Lee" wrote in message
...
Can anyone point me in the direction as to why the following fails?

Set NS = Outlook.Application.GetNamespace("MAPI")

It is done on a server that only has outlook and exel installed (Excel is
the full instlal, outlook is only partially).
--
-Lee





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Result displays "FALSE" instead of "FAIL" Formula error Excel Discussion (Misc queries) 4 April 27th 09 11:07 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
"WinForm Application" to act as "RTD Server" using .Net mduraidi Excel Discussion (Misc queries) 0 March 30th 06 01:01 PM


All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"