Hi guys! I have this for loop iterating through each folder in a file path, then it goes into the folder and gets the names of the files. Only problem is that while it should be getting the name of every file in each folder, it only gets the name of the first file. So I though a Do Until loop would solve the issue, but it didn't do anything. Any help would be great, thanks!
Note, if this is normally supposed to work (because I took this off some website [codevba.com/office/loop_files_in_folder.htm] ), is it possible that commands that I use in the Do Until loop would interfere with it? Thanks
Code:
For Each objFolder In objFolders
FileName = Dir(FilePath & "\" & objFolder.Name & "\" & objFolder.Name & "*")
Do Until FileName = ""
'Some Commands that have to do with the filename
FileName = Dir()
Loop
Note, if this is normally supposed to work (because I took this off some website [codevba.com/office/loop_files_in_folder.htm] ), is it possible that commands that I use in the Do Until loop would interfere with it? Thanks
Last edited: