In a C # program I work with an Excel workbook as follows.
using Excel = Microsoft.Office.Interop.Excel; Excel.Application excel; excel = new Excel.Application(); excel.Workbooks.Open( "1.xlsx"); Excel.Worksheet sheet = (Excel.Worksheet)excel.ActiveSheet; //Читаю некоторые ячейки excel.ActiveWorkbook.Save(); excel.ActiveWorkbook.Close(); excel.Quit(); GC.Collect(); After executing this code, the EXCEL.EXE process continues to hang in the task manager, but it terminates after my program is closed. If you remove the last 3 lines, the process hangs in the manager and does not end after closing my program. How to properly close Excel?