Option Explicit
Sub Main()
Dim fil As Object
Dim sPath As String: sPath = "c:\Test\"
With CreateObject("Scripting.FileSystemObject")
For Each fil In .GetFolder(sPath).Files
If .GetExtensionName(fil.Path) = "xlsx" Then
'*** do your stuff
End If
Next fil
End With
End Sub
|