var ExcelApp = COMCreateObject("Excel.Application");
var bb = ExcelApp.visible = true;
//Make Excel visible through the Application object.
// Place some text in the first cell of the sheet
ExcelApp.ActiveSheet.Cells(1,1).Value = "Column A, Row 1";
// Save the sheet
var fileName = "C:\\demo.xls";
ExcelApp.SaveAs (fileName);
// Close Excel with the Quit method on the Application object
ExcelApp.Application.Quit();
// Clear the object from memory
ExcelApp = null;
No comments:
Post a Comment