Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function listFiles(ByVal get_Path As String)
- Dim myArray As Variant
- Dim i As Integer
- Dim counter As Integer
- Dim xFile As Object
- Dim FileServ As Object
- Dim the_Folder As Object
- Dim the_Files As Object
- Set FileServ = CreateObject("Scripting.FileSystemObject")
- Set the_Folder = FileServ.GetFolder(get_Path)
- Set the_Files = the_Folder.Files
- If the_Files.Count = 0 Then
- Exit Function
- End If
- ReDim myArray(1 To the_Files.Count)
- i = 1
- For Each xFile In the_Files
- myArray(i) = xFile.Name
- i = i + 1
- Next
- listFiles = myArray
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement