View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Philip Wybo Philip Wybo is offline
external usenet poster
 
Posts: 2
Default Excel Remains Active in Windows Task Manager

Jake, thanks for your reply. I checked if I could find
anything that could be 'unqualified references' but
couldn't find anything alike. In fact, after I filled up
the sheet and printed it out I clear everything, using the
..clearcontens method, I unmerge the whole sheet (.unmerge),
I set all .linestyles, colors, fonts, ..... to default
value, I delete all shapes and then, before the app.quit()
I set everything (application, workbook, worksheet, range,
shapes, shaperange) to *nothing. This does help for a
part: when I unload my application, Excel is now unloaded
from the processes, but as my application keeps running
this cannot be the solution.
On the other side, I noticed now that, making a new call
to Excel, doesn't open a second instance of it but reuses
the same process as called before (the PID seems to be
linked to the calling application, even when everything is
*nothinged. I'm monitoring server and memory behavior
(since at the end 6 or 7 Excel-calling applications wil be
running).
Txs again.



-----Original Message-----
Hi Philip,

Many things can contribute to orphaned instances of Excel

lingering in the
background when Automating it. Typically, this is caused

by either 1)
unqualified references or 2) messageboxes or other items

that require user
interaction being "displayed" when the application is

hidden. In your case,
since you are making the Application visible and telling

Excel you don't
want to save changes upon close, you can probably rule

out #2. So I would
focus on #1. I don't see anything wrong with the code

you posted - perhaps
there is something in the code you omitted that is

causing a problem? The
things to watch out for are references to ActiveCell or

Selection without
specifying the workbook and/or worksheet.

If you can't find the problem, then feel free to post the

missing code so we
can try to help out.

Regards,

Jake Marx
MS MVP - Excel


"Philip Wybo" wrote in message
...
Hello,

I am running Excel2000 on Windows2000 machines. I

develop
programs in AVR (Asna Visual RPG = VB-like for RPG
programmers) to get data from our AS400 databases and
print it out through an Excel spreadsheet.
This is the general routine I use to open and close a
workbook and select the sheet:
xlApp.Visible = *true
xlBook = xlApp.Workbooks.Add()
xlSheet = xlBook.Sheets[1]
.
.
.
xlSheet.Printout
xlBook.Close(*false) (close, do not save)
xlApp.Quit()

When I then look in the TaskManager I notice that Excel
remains active and when I open a new instance from the
same or another application it is opened as a new

process
(this means after opening x applications there will be x
processes in the Task Manager.

How can I make sure that Excel will be ended in the
TaskManager Processes so that there will be no problems

to
reopen it (from the same application or from another

one?)

Thanks



.