Hi, can someone point out to me where I am going wrong in this code? I am simply trying to check a date in a text file and compare it to today. If the date is older than today then tell me. I don't know why I am getting strange results with my code. Is there a shorter way to check this?
Code:
strExpDate = "8/11/2015"
do until objTextFile.AtEndOfStream
strLine = objTextFile.ReadLine()
If InStr(strLine, strExpDate) <> 0 then
If strExpDate < Date Then
MsgBox "Out Of Date"
Else
MsgBox "Date is OK"
End If
End If
Loop