title: OpenXML SDK- Worksheet throws null reference exception
body: <p>I am using below code in order to retrieve data from excel file. And I notice that the Worksheet object of WorksheetPart throws null reference exception. Can any one tell me why this exception is thrown? Also what I can do in order to avoid this error?</p>
  
  <pre><code>SpreadsheetDocument doc = SpreadsheetDocument.Open("1.xlsx", true);
  Sheet sheet = (Sheet)doc.WorkbookPart.Workbook.Sheets.FirstOrDefault();
  WorksheetPart worksheetPart = (WorksheetPart)doc.WorkbookPart
                                                  .GetPartById(sheet.Id);
  Worksheet worksheet = worksheetPart.Worksheet; // throws null reference exception
  </code></pre>