|
复制代码 代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE>Top30销控表</TITLE>
</HEAD>
<BODY>
<input name="shanghai" type="button" class="but" id="shanghai" onClick="StartExcel('上海')" value="上海店">
<SCRIPT LANGUAGE="Javascript">...
var idTmr = "";
function StartExcel(strFileName)
...{
var oExcel;
var oWorkbook;
var strAllName;
oExcel = new ActiveXObject("Excel.Application");
//if(strFileName=null || strFileName="")
//{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);
}
function Cleanup() ...{
window.clearInterval(idTmr);
CollectGarbage();
}
</SCRIPT>
</BODY>
</HTML>
JavaScript技术:在IE中调用javascript打开Excel的代码(downmoon原作),转载需保留来源!
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。