View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steven8R Steven8R is offline
external usenet poster
 
Posts: 1
Default Excel Won't Unload...


I have an app that has a couple grids. If I load either grid from a
Excel file, no matter what I've tried, Excel will close, but no
disappear from the task manager.

I was getting all kinds of strange errors; and sometimes my cod
worked, sometimes it didn't. I finally figured out that EXCEL.EXE wa
still running (in task manager), and if I tried to load another gri
from an Excel file I'd get errors. For example, I had severa
formatting commands that sometimes worked - but ONLY if I loaded tha
grid FIRST.

Anyways, I am opening Excel, and asking for a file name, doing stuff
then want to close via code in a sub when I'm done:

Set objExcel = CreateObject("Excel.Application")
Set objBook = objExcel.Workbooks.Add
Set objSheet = objExcel.Sheets(1)
< save as xxx

to close:

objExcel.DisplayAlerts = False

' objBook.Close(SaveChanges:=False) ' <-- ** or True **

ActiveWorkbook.Close False
ThisWorkbook.Close
objExcel.Close
objExcel.Quit

Set objExcel = Nothing
Set objSheet = Nothing
Set objBook = Nothing

Tyring all kinds of stuff - but EXCEL.EXE still in task manager! An
ideas? Thanks

--
Steven8
-----------------------------------------------------------------------
Steven8R's Profile: http://www.excelforum.com/member.php...fo&userid=1548
View this thread: http://www.excelforum.com/showthread.php?threadid=27064