
function viewToExcel(){
var filepath = "f:\\PrinterExcel.xls";
var xlApp;
var xlBook;
var xlSheet;
try {
xlApp = new ActiveXObject("Excel.Application");
}
catch (e) {
alert("请调整IE安全选项");
return;
}
xlBook = xlApp.Workbooks.Open(filepath); xlSheet = xlBook.ActiveSheet;
xlSheet.Cells(1,1).value="新乡";
xlSheet.Cells(5,2).value="郑斌";
xlSheet.Cells(3,5).value="2015";
xlSheet.Cells(3,7).value="9";
xlSheet.Cells(3,8).value="27";
xlSheet.Cells(3,17).value="17408";
xlSheet.Cells(11,13).value="王泰隆"; alert("1");
xlBook.PrintOut;
xlBook.Close(true);
}