title: Unable to close excel even after releasing resources
body: <p>I have tried many solution but didn't work Please help me to fix this issue.
  Below is the code used in <strong>SSIS Script Task</strong></p>
  
  <pre><code>    using Excel = Microsoft.Office.Interop.Excel;        
              Excel.Application xlApp = null; 
              Excel.Workbooks workbooks = null;
              Excel.Workbook xlWorkbook = null;
              Excel.Worksheet worksheet = null;
              Excel.Range xlRange = null;                           
          try
            {
  
              xlApp = new Excel.Application();
              xlApp.DisplayAlerts = false;
              xlApp.AskToUpdateLinks = false;
              workbooks = xlApp.Workbooks;
              xlWorkbook = workbooks.Open("sample.csv", 2, true);
              xlWorksheet = xlWorkbook.Sheets[1];
              xlRange = xlWorksheet.UsedRange;
              int rowCount = xlRange.Rows.Count;
              for (int row = 2; row &lt;= rowCount; row++)
              {
                //some logic
  
              }
             }
      catch (Exception ex)
      {
         MessageBox.Show(ex.Message);
      }
      finally  //releasing all resources
      {
         GC.Collect();
         GC.WaitForPendingFinalizers();
         Marshal.ReleaseComObject(xlRange);
         Marshal.ReleaseComObject(xlWorksheet);
         xlRange = null;
         xlWorksheet = null;
         xlWorkbook.Close();
         Marshal.ReleaseComObject(xlWorkbook);
         xlWorkbook = null;
         workbooks = null;
         xlApp.Quit();
         Marshal.ReleaseComObject(xlApp);
         xlApp=null;
  }
  </code></pre>
  
  <p>even after releasing resources, still see one excel process </p>