在 IE 中调用 javascript 打开 Excel 表
2018-09-22 01:08
<!DOCTYPEHTMLPUBLIC“-//W3C//DTDHTML4.0Transitional//EN“>
<HTML>
<HEAD>
<METAhttp-equiv=Content-Typecontent=“text/html;charset=utf-8“>
<TITLE>打开Excel表</TITLE>
</HEAD>
<BODY>
<inputname=“shanghai“type=“button“class=“but“id=“shanghai“onClick=“StartExcel(上海)“value=“上海店“>
<SCRIPTLANGUAGE=“Javascript“>
varidTmr=““;
functionStartExcel(strFileName)
{
varoExcel;
varoWorkbook;
varstrAllName;
oExcel=newActiveXObject(“Excel.Application“);
//if(strFileName=nullstrFileName=““)
//{return;
//}
strAllName=“\\\\ep-hgh\\Top30销控表\\TOP30招商续约销控表-“+strFileName+“.xls“;
oExcel.Workbooks.Open(strAllName);
//oExcel.Workbooks.Open(“file://ep-hgh/Top30销控表/TOP30招商续约销控表-上海.xls“);
oExcel.DisplayAlerts=false;
oExcel.Visible=true;
//oExcel.Quit();
//oExcel=null;
//防EExcel死进程的关键!!必须!!!downmoon严重声明
idTmr=window.setInterval(“Cleanup();“,1000);
}
functionCleanup(){
window.clearInterval(idTmr);
CollectGarbage();
}
</SCRIPT>
</BODY>
</HTML>
文章标题:在 IE 中调用 javascript 打开 Excel 表
文章链接:http://soscw.com/essay/17129.html