public static void Quit() { if (XlApp.Workbooks.Count > 0) { XlApp.Workbooks.Close(); } if (XlApp != null) { XlApp.Quit(); } }
/// <summary> /// Closes the excel spreadsheet /// </summary> public void ExcelCloseSpreadSheet() { WorkBook.Close(); XlApp.Quit(); }