vbscript - Excel Application.Quit doesn't kill the EXECL.EXE Process -
i’ve identified strange behaviour excel’s quit
command can’t find explanation or solution to.
the vbscript script below replicates problem. here does…
- creates new excel instance
- opens , closes set number of workbooks (controlled
workbookstocreate
) - attempts
quit
excel - and proves whether excel did quit changing
visible
state true
what i’ve gathered successful quit
occurs when workbookstocreate
set 0 or 1. if set 2 or higher, excel won’t quit properly.
'switch between 1 , 2 see difference '(1 = quit correctly, 2 = quit changes .visible false) const workbookstocreate = 2 'create new excel instance set xlapp = createobject("excel.application") xlapp.visible = true 'add, , close workbooks w = 1 workbookstocreate set wb = xlapp.workbooks.add wb.close false next 'attempt quit excel xlapp.quit 'test did quit xlapp.visible = true set xlapp = nothing
i’m using excel 2010 on windows 7.
i’ve tried numerous variations on this, can’t establish problem is. best can tell xlapp.quit
does, in instance, equivalent xlapp.visible = false
interested see if of guys have better luck, or if has noticed similar behaviour excel?
thanks
+1 @omegastripes , @mikegrann identifying doesn’t happen on every machine.
i’ve investigated further , found found issue specific own work laptop. problem cannot replicated on other machines.
but have traced , fixed fault. caused 1 particular com add-in titled ciscoclicktocall.connect
. once uninstalled, script started behaving expected, , did quit.
i didn’t have uninstall windows; have been enough remove add-in excel, application don’t have use got rid of it.
from tell add-in intended add context menu commands cell’s right click.
thanks everyone’s help
Comments
Post a Comment