1.创建一个新Excel表格
????var XLObj = new ActiveXObject("Excel.Application");
????var xlBook = XLObj.Workbooks.Add;?????????????????????????//新增工作簿
????var ExcelSheet = xlBook.Worksheets(1);???????????????????//创建工作表
2.保存表格
????ExcelSheet.SaveAs("C:\\TEST.XLS");
3.使?Excel?通过Application?对象可见
????ExcelSheet.Application.Visible = true;
4.打印
????xlBook.PrintOut;
????或者:
????ExcelSheet.PrintOut;
5.关闭
????xlBook.Close(savechanges=false);
????或者:
????ExcelSheet.Close(savechanges=false);
6.结束进程
????ExcelSheet.Application.Quit();
????或者:
????XLObj.Quit();
????XLObj=null;
function endXlsObj()