Killing Excel called from Outlook

  • Thread starter Thread starter Mike Waldron
  • Start date Start date
M

Mike Waldron

Hi Everyone,

I called Excel from within Outlook. I then read some
Excel data into an array to pass back to Outlook. I use
xl.application.quit
set xl = nothing
to close Excel. It won't die. Task manager shows Excel
still active. Killing Excel from Task manager does work
either. When I rerun the macro in Outlook errors are
generated when Excel opens. As a result, I need to shut
down Outlook in order to clear Excel out of memory. Then
all my code works fine, once.

What am I doing wrong?

TIA
Mike
 
Did you also close and set the workbook and worksheet you were using to Nothing?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
"Did you also close and set the workbook and worksheet you were using to
Nothing?"

I have closed the workbooks, but it still does not work.

Set the worksheet to nothing?

Anyone else able to get this to work?
 
If objWS is your WorkSheet object, you dereference it with this statement:

Set objWS = Nothing

The newsgroup interface at Developersdex (http://www.developersdex.com) does not automatically quote the text of the original message when you post a reply. Please take the time to quote the original message manually so that people reading your current response can understand what you're talking about. Otherwise, you may not receive the answer you're looking for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
I am not using a WorkSheet object, only an Excel.Application object.

I use the following 3 lines to end the sub:

objEA.Workbooks(FileName).Close savechanges:=False
objEA.Quit
Set objEA = Nothing

Any ideas?




If objWS is your WorkSheet object, you dereference it with this
statement:

Set objWS = Nothing

The newsgroup interface at Developersdex (http://www.developersdex.com)
does not automatically quote the text of the original message when you
post a reply. Please take the time to quote the original message
manually so that people reading your current response can understand
what you're talking about. Otherwise, you may not receive the answer
you're looking for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
I found the magic that solves this!!!

Instead of looking at the end, I should have been looking at the object
creation itself.

Set objEAla = Excel.Application <--This is what I was using, but I
found that if I changed the way I created the object to,
Set objEAla = CreateObject("Excel.Application")

Then everything worked, and Excel is removed from the processes list.

Does this work due to the fact that the first method only creates a
reference to the Excel Object, while the second creates an Object
itself???


Rob



If objWS is your WorkSheet object, you dereference it with this
statement:

Set objWS = Nothing

The newsgroup interface at Developersdex (http://www.developersdex.com)
does not automatically quote the text of the original message when you
post a reply. Please take the time to quote the original message
manually so that people reading your current response can understand
what you're talking about. Otherwise, you may not receive the answer
you're looking for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
I spoke too soon. As soon as I use the range object, Excel will not
clear. I tried to define the range as an object, and then set it to
nothing once I am done, but to no avail.

This is crazy me driving!!

Any ideas?



If objWS is your WorkSheet object, you dereference it with this
statement:

Set objWS = Nothing

The newsgroup interface at Developersdex (http://www.developersdex.com)
does not automatically quote the text of the original message when you
post a reply. Please take the time to quote the original message
manually so that people reading your current response can understand
what you're talking about. Otherwise, you may not receive the answer
you're looking for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top