diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas index 7f45580cf..14e36f6c1 100755 --- a/components/fpspreadsheet/fpspreadsheet.pas +++ b/components/fpspreadsheet/fpspreadsheet.pas @@ -652,8 +652,21 @@ end; @return True if the cell is a datetime value, false otherwise } function TsWorksheet.ReadAsDateTime(ARow, ACol: Cardinal; out AResult: TDateTime): Boolean; +var + ACell: PCell; + Str: string; begin + ACell := FindCell(ARow, ACol); + if (ACell = nil) or (ACell^.ContentType <> cctDateTime) then + begin + AResult := 0; + Result := False; + Exit; + end; + + AResult := ACell^.DateTimeValue; + Result := True; end; {@@