Dim tmpDate As Date
Dim aFile As String
Dim mypath As String
Dim myname As String
mypath = "c:\temp\" ' Set the path.
myname = Dir(mypath) ' Retrieve the first entry.
Do While myname <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If myname <> "." And myname <> ".." Then
If (GetAttr(mypath & myname) And vbDirectory) = vbNormal Then
If FileDateTime(mypath & myname) > tmpDate Then
tmpDate = FileDateTime(mypath & myname)
aFile = mypath & myname
End If
End If
myname = Dir
End If
Loop
MsgBox aFile
End Sub