PC Review


Reply
Thread Tools Rate Thread

Closing Outlook VBE from Excel

 
 
Stephen Lloyd
Guest
Posts: n/a
 
      28th Oct 2008
In outlook I instatiate outlook using the following.

Set objOutlook = GetObject(, "Outlook.Application")
' If outlook was not open then instantiate outlook
If objOutlook Is Nothing Then
Set objOutlook = CreateObject("Outlook.Application")
'HandleOutlook = True
End If

In Outlook in the Application_Startup() Event I then open the VBE so that I
can call an outlook macro from excel without any popups using the following

Set objNameSpace = Application.GetNamespace("MAPI")
Set objExplorer = Application.Explorers.Add(objNameSpace.Folders(1),
olFolderDisplayFolderOnly)
objExplorer.CommandBars.FindControl(, 1695).Execute
objExplorer.Close

My problem is that I cannot figure out how to close Outlook's VBE from Excel

I'd like to use the GetObject method then using the .Quit method, but I have
been unable to locate the appname for Outlooks VBE. Does anyone know the
appname and/or a better way to close Outlook's VBE?
 
Reply With Quote
 
 
 
 
Stephen Lloyd
Guest
Posts: n/a
 
      28th Oct 2008
Quick correction... In Excel I instantiate outlook using the following

> Set objOutlook = GetObject(, "Outlook.Application")
> ' If outlook was not open then instantiate outlook
> If objOutlook Is Nothing Then
> Set objOutlook = CreateObject("Outlook.Application")
> 'HandleOutlook = True
> End If
>
> In Outlook in the Application_Startup() Event I then open the VBE so that I
> can call an outlook macro from excel without any popups using the following
>
> Set objNameSpace = Application.GetNamespace("MAPI")
> Set objExplorer = Application.Explorers.Add(objNameSpace.Folders(1),
> olFolderDisplayFolderOnly)
> objExplorer.CommandBars.FindControl(, 1695).Execute
> objExplorer.Close
>
> My problem is that I cannot figure out how to close Outlook's VBE from Excel
>
> I'd like to use the GetObject method then using the .Quit method, but I have
> been unable to locate the appname for Outlooks VBE. Does anyone know the
> appname and/or a better way to close Outlook's VBE?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is my Outlook closing when I am simply closing a mail message WendyG Microsoft Outlook Discussion 1 9th Dec 2008 03:14 AM
Closing Outlook VBE from Excel Stephen Lloyd Microsoft Outlook VBA Programming 2 29th Oct 2008 12:11 AM
Outlook Script: Pb closing Excel bbnimda Microsoft Outlook Form Programming 0 18th Jan 2008 03:41 PM
Problem when reading closing Outlook form that uses Excel sheet adammfellows@liberata.com Microsoft Outlook Form Programming 0 9th Nov 2006 03:34 PM
Closing excel application without closing all workbooks at the sa. =?Utf-8?B?S2l3aSBSb3hpZQ==?= Microsoft Excel Setup 2 30th Oct 2004 02:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:47 AM.