title: How to read an Excel spreadsheet in c# quickly
body: <p>I am using Microsoft.Office.Interop.Excel to read a spreadsheet that is open in memory.</p>
  
  <pre><code>gXlWs = (Microsoft.Office.Interop.Excel.Worksheet)gXlApp.ActiveWorkbook.ActiveSheet;
  int NumCols = 7;
  string[] Fields = new string[NumCols];
  string input = null;
  int NumRow = 2;
  while (Convert.ToString(((Microsoft.Office.Interop.Excel.Range)gXlWs.Cells[NumRow, 1]).Value2) != null)
  {
      for (int c = 1; c &lt;= NumCols; c++)
      {
          Fields[c-1] = Convert.ToString(((Microsoft.Office.Interop.Excel.Range)gXlWs.Cells[NumRow, c]).Value2);
      }
      NumRow++;
  
      //Do my other processing
  }
  </code></pre>
  
  <p>I have 180,000 rows and this turns out be very slow. I am not sure the "Convert" is efficient. Is there anyway I could do this faster?</p>
  
  <p>Moon</p>