<! 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('test') " value = " 打开test.xls " > < SCRIPT LANGUAGE = " Javascript " > var idTmr = "" ; function StartExcel(strFileName) ... {var oExcel;var strAllName;oExcel = new ActiveXObject("Excel.Application");strAllName="D:/"+strFileName+".xls";oExcel.Workbooks.Open(strAllName);oExcel.DisplayAlerts = false;oExcel.Visible = true;idTmr = window.setInterval("Cleanup();",1000);} function Cleanup() ... {window.clearInterval(idTmr);CollectGarbage();} </ SCRIPT > </ BODY > </ HTML >