title: How can we delete row from excel using NPOI?
body: <p>I am using below code to delete upper rows from .xlsx and I successfully installed NPOI library. It executed successfully but it is unable to delete rows.</p>
  <pre><code>namespace A
  {
      class B
      {
              path = &quot;File path&quot;;
              XSSFWorkbook hswb;
              using(FileStream file = new FileStream(path,FileMode.Open,FileAccess.ReadWrite))
              {
                  hswb = new XSSFWorkbook(file);
              }
  
              ISheet sheet = hswb.GetSheetAt(0);
              for (int row = 0; row &lt;= sheet.LastRowNum; row++)
              {
                  var row1 = sheet.GetRow(row);
                  if((row&lt;3) &amp;&amp; row1 != null)
                  {
                      sheet.RemoveRow(row1);
                      sheet.ShiftRows(row+1,sheet.LastRowNum,-1);
                  }
              }
      }
      
  }
  </code></pre>
  <p>Please help me..
  Thanks in Advance!</p>