Code: Select all
Public Sub LoopAllFilesInFolder()
Dim folderName As String
Dim FSOLibrary As Object
Dim FSOFolder As Object
Dim FSOFile As Object, NOMEFILE As String
folderName = "C:\Lavori_Vb6\MAPPA_ITALIA\FILES\PR_ZIP\"
Set FSOLibrary = CreateObject("Scripting.FileSystemObject")
Set FSOFolder = FSOLibrary.GetFolder(folderName)
For Each FSOFile In FSOFolder.Files
NOMEFILE = FSOFile.Name
Next
Set FSOLibrary = Nothing
Set FSOFolder = Nothing
End Sub