I didn't expect this to work, but under certain condtions it seems to. When I set the datevalue to (Date()-2) or +20, which is next month, it works. The filedatetime is (06/07/2008 5:32:44 PM).
Code:
Sub main
CurrFile=DateValue(Date()-2) & " " & TimeValue(Time())
PrevFile=FileDateTime("h:\" & Format(Date-1, "mm.dd.yy") & "_excel ccmbalance.xls")
If CurrFile<=PrevFile then
MsgBox CurrFile & " " & "Less than or equal to" & " " & PrevFile
End If
If CurrFile>=PrevFile then
MsgBox CurrFile & " " & "Greater than or equal to" & " " & PrevFile
End If
End Sub