Hi,
If have written a small VBA program that shows all the files in a directory and it works as a charm:
What I would like that it only shows the files of a certain filemask. Is it possible to use the FileSystemObject to get only the files of a certain filemask and loop through them?
Thanks in advance.
Regards,
Rob.
If have written a small VBA program that shows all the files in a directory and it works as a charm:
Code:
Public Sub LoopFiles()
Dim strPath As String
Dim objFso As FileSystemObject
Dim objFolder As Folder
Dim objFile As File
strPath = "C:\Windows"
Set objFso = New FileSystemObject
Set objFolder = objFso.GetFolder(strPath)
For Each objFile In objFolder.Files
Debug.Print objFile.Name
Next
End Sub
Thanks in advance.
Regards,
Rob.