title: C# - Proper way to open and close an excel file programmatically
body: <p>I can't seem to find the proper way to open and close an excel file.</p>
  
  <p>Here is what I have to open my file, which I find overly complicated:</p>
  
  <pre><code>        Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
  
          Microsoft.Office.Interop.Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath,
              0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "",
              true, false, 0, true, false, false);
          Microsoft.Office.Interop.Excel.Sheets excelSheets = excelWorkbook.Worksheets;
  
          Worksheet sheet = (Microsoft.Office.Interop.Excel.Worksheet)excelApp.Worksheets[2];
          sheet.Select(Type.Missing);
  </code></pre>
  
  <p>I have no idea how to properly close it. I need to save it with the same path and make sure excel is not still running in the background after it is closed.</p>
  
  <p>Can someone make it easy for me?
  Thanks</p>