title: How to NOT skip empty rows when reading Excel sheet?
body: <p>I am using Microsoft.Office.Interop.Excel to read an Excel file.</p>
  
  <p>The problem I am having is that when reading, it counts the first row that has information as row 1. So, if the first row to have information is row 3, it counts that as the first row. This is a problem because the Excel sheets sometimes have data on the first 2 rows, sometimes they don't. But the data I need to read always starts on the third row.</p>
  
  <p>Here is the routine I am using to read the sheets:</p>
  
  <pre><code>Microsoft.Office.Interop.Excel.Application exl = new Microsoft.Office.Interop.Excel.Application();
          Workbooks wkbs = exl.Workbooks;
          Microsoft.Office.Interop.Excel.Workbook wkb = null;
          Sheets shts;
          Microsoft.Office.Interop.Excel.Worksheet wks = null;
  
          // load work book
          //wkb = wkbs.Open(races_data_path, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);//oMissing
          wkb = wkbs.Open(races_data_path, Type.Missing, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);//oMissing
  
          shts = wkb.Sheets;
          wks = (Microsoft.Office.Interop.Excel.Worksheet)shts.get_Item(Properties.Settings.Default.excel_worksheet);
  
          // read lines from worksheet
          Microsoft.Office.Interop.Excel.Range range = wks.UsedRange;
  
          for (int rCnt = 1; rCnt &lt;= range.Rows.Count; rCnt++)
          {
              try
              {
                  object[,] values = (object[,])range.Value2;
  
                  if (Convert.ToString(values[rCnt, 4]) != "")
                  {
                      //Console.WriteLine(String.Format("Ldd: {0} {1} {2}", Convert.ToInt16(values[rCnt, 2]), Convert.ToInt16(values[rCnt, 3]), Convert.ToString(values[rCnt, 4])));
                      if (races[Convert.ToInt16(values[rCnt, 1])] == null) races[Convert.ToInt16(values[rCnt, 1])] = new RaceObject();
  
                      races[Convert.ToInt16(values[rCnt, 1])].add_racer(Convert.ToInt16(values[rCnt, 2]), Convert.ToInt16(values[rCnt, 3]), Convert.ToString(values[rCnt, 4]), Convert.ToString(values[rCnt, 7]));
                  }
  
              }
              catch (Exception ex)
              {
                  data_loaded = false;
                  rCnt = range.Rows.Count;
              }
  
          }
  </code></pre>
  
  <p>This example, you can see the loop count starts at '1'. This was for reading a sheet where the first 2 lines of the sheet were empty. If the first 2 lines have data, then this loop only works if I change the count start to '3'.</p>
  
  <p>For example:
  The start value = 1 if the sheet looks like this:</p>
  
  <pre><code>no data
  no data
  has data
  has data
  has data
  </code></pre>
  
  <p>The start value = 3 if the sheet looks like this:</p>
  
  <pre><code>has unnecessary data
  has unnecessary data
  has data
  has data
  has data
  </code></pre>