Excel.exe process not being cleaned up

Forums for specific tips, techniques and example code
alanvl
Posts: 29
Joined: Fri Aug 14, 2009 9:16 pm

Excel.exe process not being cleaned up

Postby alanvl » Tue May 31, 2016 5:33 pm

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

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Excel.exe process not being cleaned up

Postby BeeJay » Fri Jun 03, 2016 3:01 pm

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.

alanvl
Posts: 29
Joined: Fri Aug 14, 2009 9:16 pm

Re: Excel.exe process not being cleaned up

Postby alanvl » Fri Jun 03, 2016 9:55 pm

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?

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Excel.exe process not being cleaned up

Postby BeeJay » Tue Jun 07, 2016 7:49 am

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.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 22 guests