请教一个问题
mhh 2003-11-27 02:47:46 我有如下程序
<script language="JavaScript">
function AutomateExcel()
{
//alert("您必须输入使用摘要。")
// Start Excel and get Application object.
var oXL = new ActiveXObject("excel.Application");
// Get a new workbook.
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var table = document.all.table;
var hang = table.rows.length;
var lie = table.rows(0).cells.length;
// Add table headers going cell by cell.
for (i=0;i<hang;i++)
{
for (j=0;j<lie;j++)
{
oSheet.Cells(i+1,j+1).value = table.rows(i).cells(j).innerText;
}
}
oXL.Visible = true;
oXL.UserControl = true;
}
//-->
</script>
但在执行的时候var oXL = new ActiveXObject("excel.Application");这句总是出错,报的错是"Automation服务器不能创建对象",请问这是什么原因?