Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Remains Active in Windows Task Manager

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Excel Remains Active in Windows Task Manager

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



.

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
Excel close on startup, but stay in task manager Thomas Excel Discussion (Misc queries) 3 May 20th 10 06:58 AM
Windows in task bar in MS EXCEL 2007 Subramanya New Users to Excel 1 January 26th 10 05:41 PM
Excel still running in task manager after closing the application Willem Excel Discussion (Misc queries) 0 December 5th 06 01:56 PM
Printing leaves EXCEL.EXE process in Task Manager eeidfn Excel Discussion (Misc queries) 1 February 28th 06 02:24 AM
Task Manager and Excel 2003 Mike Excel Discussion (Misc queries) 1 April 20th 05 10:40 PM


All times are GMT +1. The time now is 02:52 AM.

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

About Us

"It's about Microsoft Excel"