Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Issue: Excel file opening fail if there is no WorkbookProperties defined [8537]

$
0
0
If a excel File has no WorkbookProperties defined the document load fails.

ClosedXML.Excel.XLWorkbook_Load.cs

var date1904 = dSpreadsheet.WorkbookPart.Workbook.WorkbookProperties.Date1904;

It raise "Object reference not set to an instance of an object"
Comments: This was fixed in the August 22-2013 commit. - var date1904 = dSpreadsheet.WorkbookPart.Workbook.WorkbookProperties.Date1904; - Use1904DateSystem = date1904 != null && date1904.Value; + + var wbProps = dSpreadsheet.WorkbookPart.Workbook.WorkbookProperties; + Use1904DateSystem = wbProps != null && wbProps.Date1904 != null && wbProps.Date1904.Value;

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>