使用javascript时在任务管理器中结束进程

时间:2013-07-11 02:07:39

标签: javascript html excel activex

此脚本运行正常,但它会在任务管理器“进程”部分中不断创建新进程。不是应用程序,只是进程。我以为我正在使用写'退出'选项,但显然不是!这是代码:

<script>

function gbid(s)    {
return document.getElementById(s);
}

function GetData(cell,row){
var excel = new ActiveXObject("Excel.Application");
var excel_file = excel.Workbooks.Open("44227.xls");
var excel_sheet = excel.Worksheets("sheet1");

gbid('span1').innerText = excel_sheet.Cells(93,1).Value;    
gbid('span2').innerText = excel_sheet.Cells(95,3).Value;    
gbid('span3').innerText = excel_sheet.Cells(94,4).Value;    
gbid('span4').innerText = excel_sheet.Cells(95,4).Value;
gbid('span5').innerText = excel_sheet.Cells(95,5).Value;


gbid('span6').innerText = excel_sheet.Cells(97,1).Value;
gbid('span7').innerText = excel_sheet.Cells(99,3).Value;
gbid('span8').innerText = excel_sheet.Cells(98,4).Value;
gbid('span9').innerText = excel_sheet.Cells(99,4).Value;
gbid('span10').innerText = excel_sheet.Cells(99,5).Value;

excel_file.Close();
excel.Application.Quit();
excel.Close();
}
</script>
<body onload="GetData();" />

剩下的就是桌子,所以没什么大不了的。无重要代码或任何内容。正如你所看到的,我尝试了三种不同类型的线,我甚至自己尝试过它们。 NADA!我甚至没有尝试过';'在末尾!我搜索了这个网站,并使用了这些例子,但它只是工作!它将继续创造新的流程!是因为我用过: new ActiveXObject("Excel.Application");

0 个答案:

没有答案
相关问题