excelWorkbook.SaveAs(@"D:\RiteFile\" + filename + ".xlsm"); string path = @"D:\RiteFile\" + filename + ".xlsm"; //excelApp.Visible = true; excelApp.UserControl = false; excelWorkbook.Close(); excelApp.Workbooks.Close(); excelApp.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWorkbook); System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp); excelWorkbook = null; excelApp = null; System.Diagnostics.Process.Start(path); } } catch (Exception ex) { //UserUtil.Message(ex.Message, this); excelApp.UserControl = false; //excelWorkbook.Close(); excelApp.Workbooks.Close(); excelApp.Quit(); //System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWorkbook); System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp); //excelWorkbook = null; excelApp = null; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)