I am trying to list all the subfolders in a folder.
There are no error codes it just does not print out.
Code
Dim objFSO3 As Object
Dim objFolder3 As Object
Dim objSubFolder3 As Object
Set objFSO3 = CreateObject("Scripting.FileSystemObject")
dir3 = "C:\mypath\"
Set objFolder3 = objFSO3.GetFolder(dir3)
For Each objSubFolder3 In objFolder3.SubFolders
p = p + 1
Cells(p + 2, 12) = objSubFolder3.Name
Next
Set objFolder3 = Nothing
Set objSubFolder3 = Nothing
Set objFSO3 = Nothing
Display More