JavaScript打开EXCEL后,最后释放进程的方法
var idTmr = "";
function Cleanup() {
window.clearInterval(idTmr);
CollectGarbage();
}
function AutomateExcel()
{
var oXL = new ActiveXObject("Excel.Application");
oXL.DisplayAlerts = false
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
oXL.Visible = true;
oXL.UserControl = false;
oXL = null;
idTmr = window.setInterval("Cleanup();",1);
}