å°åï¼ä½ è¿æ°å¥½ï¼æååè¿ï¼æ¾äºå¾ä¹
ææ¾å°ä¸ªè½ç¨çã
<SCRIPT LANGUAGE="javascript">
<!--
function AutomateExcel() {
var elTable = document.getElementById("table1"); //table1æ¹æä½ çtableID
var oRangeRef = document.body.createTextRange();
oRangeRef.moveToElementText(elTable);
oRangeRef.execCommand("Copy");
try {
var appExcel = new ActiveXObject("Excel.Application");
} catch (e) {
alert("æ æ³è°ç¨Office对象ï¼è¯·ç¡®ä¿æ¨çæºå¨å·²å®è£
äºOffice并已å°æ¬ç³»ç»çç«ç¹åå å
¥å°IEçä¿¡ä»»ç«ç¹å表ä¸ï¼");
return;
}
appExcel.Visible = true;
appExcel.Workbooks.Add().Worksheets.Item(1).Paste();
appExcel = null;
}
//-->
</SCRIPT>
è°ç¨
<input type="button" name="out_excel" onClick="AutomateExcel();" value="导åºå°excel" class="notPrint">
温馨提示:答案为网友推荐,仅供参考