title: How to close ExcelPackage using EPPlus in C#?
body: <p>I'm using epplus to write in a file an extense quantity of information in an excel template, but then I need to close the ExcelPackage as to be usable with the Excel application. It throws me this exception: "System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC"</p>
  
  <pre><code>    private void FillCardsSheet()
      {
          xlPackage = new ExcelPackage(Template);
  
          wsCards = xlPackage.Workbook.Worksheets[4];
  
          string command = "SELECT * FROM dbo_serial_cards WHERE type &lt;&gt; 'EXT' AND LEFT([device_tag], 2) &lt;&gt; '!!'";
          OleDbCommand cmd = new OleDbCommand(command, CON);
          OleDbDataReader reader = cmd.ExecuteReader();
          int row = 1;
          while (reader.Read())
          {
              row++;
              for (int col = 1; col &lt;= 16; col++)
              {
                  wsCards.Cells[row, col].Value = reader.GetValue(col - 1);
              }
          }
  
          xlPackage.SaveAs(Template);
          xlPackage.Dispose();
      }
  </code></pre>