Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel close on startup, but stay in task manager | Excel Discussion (Misc queries) | |||
Windows in task bar in MS EXCEL 2007 | New Users to Excel | |||
Excel still running in task manager after closing the application | Excel Discussion (Misc queries) | |||
Printing leaves EXCEL.EXE process in Task Manager | Excel Discussion (Misc queries) | |||
Task Manager and Excel 2003 | Excel Discussion (Misc queries) |