-----021-ActiveXObject.html-----
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <title>ActiveXObject</title> 6 </head> 7 <body> 8 <script type="text/javascript"> 9 ExcelApp = new ActiveXObject("Excel.Application");//初始化Excel.Application 10 ExcelSheet = new ActiveXObject("Excel.Sheet"); 11 ExcelSheet.Application.Visible = true;//可以看到Excel界面一闪而过 12 ExcelSheet.ActiveSheet.Cells(1, 1).value = "一一"; 13 ExcelSheet.ActiveSheet.Cells(2, 2).value = "二二"; 14 ExcelSheet.ActiveSheet.Cells(3, 3).value = "三三"; 15 ExcelSheet.SaveAs("C:/users/button/desktop/test.xls"); 16 ExcelSheet.Application.Quit(); 17 </script> 18 </body> 19 </html>