Page 1 of 1
Excel.exe process not being cleaned up
Posted: Tue May 31, 2016 5:33 pm
by alanvl
We currently have an issue where the excel.exe (Office 2013) created via Jade / ActiveX processing is not being "cleaned-up" - it stays in the process list.
I am pretty sure that the worksheet and workbook objects are being cleaned up (after the successful save). I delete the Application object after doing the quit.
Does anyone have a fix for this?
Ta
Alan v.L
Re: Excel.exe process not being cleaned up
Posted: Fri Jun 03, 2016 3:01 pm
by BeeJay
When I run some of our reports that programmatically drive Excel, the process appears for the duration of the report but definitely goes away as expected after we do the 'excelObject.quit' call and delete the 'excelObject'. We do, however, always do this in our method epilog section to ensure any exception that cuts the stack back will still clean-up our connection to Excel.
Could an exception cutting the stack back potentially be a cause of the issue you're encountering, such that the 'excelObject.quit' isn't being called on the occasions when the excel.exe process is unexpectedly left running?
Cheers,
BeeJay.
Re: Excel.exe process not being cleaned up
Posted: Fri Jun 03, 2016 9:55 pm
by alanvl
Hi BeeJay
Thanks for the response, yep, we do the quit and delete in the epilog as well, also there is no indication of any exception - could it be some excel related objects that I have created (e.g. Style, Range etc) - do you clean these up manually?
Re: Excel.exe process not being cleaned up
Posted: Tue Jun 07, 2016 7:49 am
by BeeJay
Alan,
Yes, we do manually delete all Excel related objects that we have created, generally in the method that created them, to prevent transient leaks or leave anything behind that could 'potentially prevent' the Excel process from closing down when we issue the quit command.
If you have CardSchema in your hierarchy, it may be worth putting in a call to the dump undeleted transients method immediately before the quit to see if you've left any automation objects behind, and put in code in the relevant method to cleanup the leaked transients and see if that addresses the issue. If it doesn't, then I can't really offer much more advice as you're already doing the quit in an epilog, which was going to be one suggestion to try if you weren't already using that technique.
Cheers,
BeeJay.