title: How to get a specific row by worksheet and rowindex in excel file
body: <p>I need to choose a specific cell in my excel file via using openXML:</p>
  
  <pre><code>Worksheet workSheet = workSheetPart.Worksheet;
  Cell cell = GetCell(workSheet, "B", 2);
  
  
  private static Cell GetCell(Worksheet worksheet,
    string columnName, uint rowIndex)
      {
          Row row = GetRow(worksheet, rowIndex);
  
          if (row == null)
              return null;
  
          return row.Elements&lt;Cell&gt;().Where(c =&gt; string.Compare
                 (c.CellReference.Value, columnName +
                 rowIndex, true) == 0).First();
      }
  
  private static Row GetRow(Worksheet worksheet, uint rowIndex)
      {
          var test = worksheet.GetFirstChild&lt;SheetData&gt;().
            Elements&lt;Row&gt;().Where(r =&gt; r.RowIndex == rowIndex).First(); //Here is the problem. 
  
  return worksheet.GetFirstChild&lt;SheetData&gt;().
            Elements&lt;Row&gt;().Where(r =&gt; r.RowIndex == rowIndex).First();
      }
  </code></pre>
  
  <p>When debugging I have noticed that RowIndex is null, so this is causing the problem I guess in the linq query</p>