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

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -