Hello, I am looking for some help with my Code. I am getting a File not Found error whenever I try to use anything but the root directory "C:" for the PathName.
Thanks, CB
Thanks, CB
Code:
Sub GetSubFolderNames()
Dim FileName As String
Dim PathName As String
PathName = "C:\Temp"
FileName = Dir(PathName, vbDirectory)
Do While FileName <> ""
If GetAttr(PathName & FileName) = vbDirectory Then
Debug.Print FileName
End If
FileName = Dir()
Loop
End Sub