title: How to delete all hidden rows EPPlus C# excel
body: <p>I have an excel sheet with hidden rows and I wrote a code to try and delete those rows using EPPlus, but this code doesn't delete all the hidden rows - it appears that it misses some rows randomly.</p>
  <p>Any idea why?</p>
  <pre><code>var start = loadedWorksheet.Dimension.Start;
  var end = loadedWorksheet.Dimension.End;
  
  for (int row = start.Row; row &lt;= end.Row; row++)
              {
                  if (loadedWorksheet.Row(row).Hidden == true)
                  {
                      loadedWorksheet.DeleteRow(row);
                  }
              }
  
              loadedExcelPackage.Save(); 
  </code></pre>