S
Stan Scott
Don,
Google "File System Object" or "FSO". This ActiveX object will do exactly
what you need. For example, this Excel code lists all of the folders
immediately under the C:\ drive:
Sub runFolderList()
On Error Resume Next
Dim rootFolder
Dim subFolders
Set fso = CreateObject("Scripting.FileSystemObject")
Set rootFolder = fso.GetFolder("C:\")
Set subFolders = rootFolder.subFolders
For Each folder In subFolders
Debug.Print "Folder: " & folder.Name
Next
Set subFolders = Nothing
Set rootFolder = Nothing
Set fso = Nothing
End Sub
Hope this helps,
Stan Scott
New York City
Google "File System Object" or "FSO". This ActiveX object will do exactly
what you need. For example, this Excel code lists all of the folders
immediately under the C:\ drive:
Sub runFolderList()
On Error Resume Next
Dim rootFolder
Dim subFolders
Set fso = CreateObject("Scripting.FileSystemObject")
Set rootFolder = fso.GetFolder("C:\")
Set subFolders = rootFolder.subFolders
For Each folder In subFolders
Debug.Print "Folder: " & folder.Name
Next
Set subFolders = Nothing
Set rootFolder = Nothing
Set fso = Nothing
End Sub
Hope this helps,
Stan Scott
New York City