Function File_Date(strFileName As String) As String On Error GoTo Kraj Dim strDate As String Dim intcount As Integer strDate = FileDateTime(strFileName) intcount = InStr(1, strDate, " ", vbTextCompare) File_Date = CDate(Mid$(strDate, 1, intcount)) Exit Function Kraj: MsgBox "Ne postoji Fajl" End Function