Getting the Value for a Date
Comments: If the Following Code Contains a Date in Cell A2, I Get a System.FormatException -- same as the time Code: XLWorkbook rdsWorkbook = new XLWorkbook(rdsFile); var p = rdsWorkbook.Worksheet("Sheet1").Range("A2").FirstCell(); Immediate Window: Hyperlink: {ClosedXML.Excel.XLHyperlink} NewDataValidation: {ClosedXML.Excel.XLDataValidation} RichText: {1/1/2013} ShareString: true Style: {Font:False-False-Single-False-Baseline-False-11-Color Theme: Text1, Tint: 1-Calibri-Swiss Fill:Color Index: 64-None-Color Index: 64 Border:None-FF000000-None-FF000000-None-FF000000-None-FF000000-None-FF000000-False-False NumberFormat: 14- Alignment: General-Bottom-0-False-ContextDependent-0-False-0-False- Protection: Locked} Value: 'rdsWorkbook.Worksheet("Sheet1").Range("A2").FirstCell().Value' threw an exception of type 'System.FormatException' ValueCached: null Worksheet: {'Sheet1'!A1:XFD1048576}
Comments: If the Following Code Contains a Date in Cell A2, I Get a System.FormatException -- same as the time Code: XLWorkbook rdsWorkbook = new XLWorkbook(rdsFile); var p = rdsWorkbook.Worksheet("Sheet1").Range("A2").FirstCell(); Immediate Window: Hyperlink: {ClosedXML.Excel.XLHyperlink} NewDataValidation: {ClosedXML.Excel.XLDataValidation} RichText: {1/1/2013} ShareString: true Style: {Font:False-False-Single-False-Baseline-False-11-Color Theme: Text1, Tint: 1-Calibri-Swiss Fill:Color Index: 64-None-Color Index: 64 Border:None-FF000000-None-FF000000-None-FF000000-None-FF000000-None-FF000000-False-False NumberFormat: 14- Alignment: General-Bottom-0-False-ContextDependent-0-False-0-False- Protection: Locked} Value: 'rdsWorkbook.Worksheet("Sheet1").Range("A2").FirstCell().Value' threw an exception of type 'System.FormatException' ValueCached: null Worksheet: {'Sheet1'!A1:XFD1048576}