日期:2014-05-17 浏览次数:20762 次
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wb = null;
Microsoft.Office.Interop.Excel.Sheets sh = null;
excel.Application.Workbooks.Add(true);
excel.Cells[1, 1] = "1";
excel.Cells[1, 2] = "abc";
excel.Cells[2, 1] = "2";
excel.Cells[2, 2] = "ddg";
excel.Cells[3, 1] = "3";
excel.Cells[3, 2] = "hello boy";
excel.Cells[4, 1] = "3";
excel.Cells[4, 2] = "what";
excel.Visible = false;
excel.DisplayAlerts = false;
excel.AlertBeforeOverwriting = false;
excel.ActiveWorkbook.SaveCopyAs(@"d:\123.xls");
excel.Quit();