How to close Excel c# -
this code, have seen others closing excel sheets way why not work. there no errors in code execution app still seems running in background
microsoft.office.interop.excel.application excel = new microsoft.office.interop.excel.application(); microsoft.office.interop.excel.workbook sheet = excel.workbooks.open("c:\\users\\maxine\\testing.xlsx"); microsoft.office.interop.excel.worksheet x = ((microsoft.office.interop.excel.worksheet)excel.activesheet); sheet.close(false,type.missing,type.missing); excel.quit();
you need release com object. see here, need marshal.finalreleasecomobject on excel object.
Comments
Post a Comment