You need to add Microsoft Scripting Library to your references for this
to work.
Dim fso As FileSystemObject
Dim objFolder As Folder
Dim objFile As File
Dim strName As String
Set fso = New FileSystemObject
Set objFolder = fso.GetFolder("C:\MyDocs")
For Each objFile In objFolder.Files
strName = objFile.Path
If Right(strName, 4) = ".xls" Then
MsgBox "It's there!"
End If
Next