<javascript> function button1_onclick() { ExcelApp = new ActiveXObject("Excel.Application"); ExcelSheet = new ActiveXObject("Excel.Sheet"); ExcelSheet.Application.Visible = true; // Place some text in the first cell of the sheet. ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1"; // Save the sheet. ExcelSheet.SaveAs("C:\\TEST.XLS"); // Close Excel with the Quit method on the Application object. ExcelSheet.Application.Quit(); } </javascript>
也许你该去.Net板块看看。
相关的例子:http://dev.csdn.net/user/qiume
function button1_onclick() {
ExcelApp = new ActiveXObject("Excel.Application");
ExcelSheet = new ActiveXObject("Excel.Sheet");
ExcelSheet.Application.Visible = true;
// Place some text in the first cell of the sheet.
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
// Save the sheet.
ExcelSheet.SaveAs("C:\\TEST.XLS");
// Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit();
}
</javascript>