Scriptom (groovy) leaves Excel process running - am I doing something wrong?
Posted
by Alex Stoddard
on Stack Overflow
See other posts from Stack Overflow
or by Alex Stoddard
Published on 2010-03-17T14:03:32Z
Indexed on
2010/05/05
20:08 UTC
Read the original article
Hit count: 342
I am using the Scriptom extension to Groovy 1.7.0 to automate some processing using Excel 2007 under Windows XP.
This always seems to leave an Excel process running despite my calling quit on the excel activeX object. (There is a passing reference to this phenomenon in the Scriptom example documentation too.)
Code looks like:
import org.codehaus.groovy.scriptom.ActiveXObject;
def xls = new ActiveXObject("Excel.Application")
xls.Visible = true
// do xls stuff
xls.Quit()
The visible excel window does disappear but an EXCEL process is left in the task manager (and more processes pile up with each run of the script).
There are no error message or exceptions.
Can anyone explain why the Excel process is left behind and is there any way to prevent it from happening?
© Stack Overflow or respective owner