我写了个这样的代码: Response.Buffer = TRUE Response.AddHeader "Content-Disposition", "attachment; filename=excel.xls" Response.contentType="application/vnd.ms-excel" 可输出一大串数字到EXCEL里就变成科学计数法了,后面几位数也都变成0 网上看到一个这样的代码: <SCRIPT LANGUAGE="javascript"> <!-- function AutomateExcel() { // 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.data; 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> <input type="hidden" name="out_excel" onclick="AutomateExcel();" value="导出到excel" class="notPrint"> 可就是输不出 大侠们帮帮我 怎么输出后控制EXCEL里显示的格式