title: EPPlus not saving changes to worksheet
body: <p>I have a batch job that loops through a spreadsheet processing each record row by row. Depending on the results, I want to leave a comment in the last column of each record. </p>
  
  <p>I can tell, by monitoring the value in this cell while the program's running, that the appropriate changes are going where they need to. However, after running the <code>.Save()</code> function I open the spreadsheet and each column looks the same as it did before the program was run. </p>
  
  <p>It seems like they built <a href="https://epplus.codeplex.com/" rel="nofollow">EPPlus</a> to be pretty straightforward with regard to saving your changes, so I'm not sure what I'm doing wrong. </p>
  
  <p>Here is how I open the spreadsheet</p>
  
  <pre><code>if (File.Exists(path))
  {
      try
      {
          //Connect to spreadsheet
          FileStream _stream = File.Open(path, FileMode.Open, FileAccess.ReadWrite);
          FileInfo file = new FileInfo(path);
  
      }
      catch (IOException)
      {
          SendEmail.OkMail("Spreadsheet is currently in use. Please close and try again.");
  
          //Exit program
          Environment.Exit(0);
      }
  
      //Pull data into EPPlus object
      _package = new ExcelPackage();
      _package.Load(_stream);
      _sheet = _package.Workbook.Worksheets.First(); 
  }
  else
  {
      //Notify user and exit program
      SendEmail.OkMail("Cannot find file in requested directory. Please check and try again.");
  
      //Exit program
      Environment.Exit(0);
  }
  </code></pre>
  
  <p>This code makes the appropriate changes. While stepping through this part of the code, I can see that the right value is being stored in the correct cell of the <code>ExcelWorkSheet</code> object named <code>_sheet</code></p>
  
  <pre><code>//Figure out what type of update occurred
  if (ignore == (_noUpdates - 1))
  {
      _sheet.Cells[row, col + 11].Value = "Ignore";
  }
  else if (add == (_adds - 1))
  {
      _sheet.Cells[row, col + 11].Value = "Valid Add";
  }
  else if (update == (_updates - 1))
  {
      _sheet.Cells[row, col + 11].Value = "Valid Update";
  }
  else if (autoterm == (_autotermed - 1))
  {
      _sheet.Cells[row, col + 11].Value = "Valid Autoterm";
  } 
  </code></pre>
  
  <p>Once I'm done looping through the spreadsheet, I make this call to the <code>.Save()</code> function. Nothing happening here though. Changes are not being saved. </p>
  
  <pre><code>//Save changes to spreadsheet.
  _package.Save();
  </code></pre>