F
faberk
I have a requirement to perform mass changes to the footers of .xls files.
Using the filesystemobect, i have managed to display the names of the folders
immediately subordinate to my main path. I would like to loop through all
fodlers. There are many levels. Pasting what i have written to date. Any
ideas?
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoSubFolders As Folders
Dim fsoFile As Object
Dim strHomeFolder As String
Dim strFolderName As String
On Error GoTo btnXL_Click_Error
strHomeFolder = "C:\ASOX\SOX Testing\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fsoFolder = fso.GetFolder(strHomeFolder)
'loop through the subfolder collection, displaying folder names
For Each fsoFolder In fsoFolder.SubFolders
strFolderName = fsoFolder.Name
MsgBox strFolderName, vbInformation, "displaying folder names"
Next
On Error GoTo 0
Exit Sub
T.I.A.
Using the filesystemobect, i have managed to display the names of the folders
immediately subordinate to my main path. I would like to loop through all
fodlers. There are many levels. Pasting what i have written to date. Any
ideas?
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoSubFolders As Folders
Dim fsoFile As Object
Dim strHomeFolder As String
Dim strFolderName As String
On Error GoTo btnXL_Click_Error
strHomeFolder = "C:\ASOX\SOX Testing\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fsoFolder = fso.GetFolder(strHomeFolder)
'loop through the subfolder collection, displaying folder names
For Each fsoFolder In fsoFolder.SubFolders
strFolderName = fsoFolder.Name
MsgBox strFolderName, vbInformation, "displaying folder names"
Next
On Error GoTo 0
Exit Sub
T.I.A.