==[[Excel VBA ディレクトリの再帰処理]]==[[Excel VBA]] | {{category [[Category:VBAソース片}}]]
===FileSystemObjec===
Const FileAttrNormal = 0
Const FileAttrReadOnly FileAttr[[R]]eadOnly = 1
Const FileAttrHidden = 2
Const FileAttrSystem = 4
Dim folder As Object
Set fso = CreateObject("Scripting.[[FileSystemObject]]")
Set folder = fso.GetFolder("c:\")
If path.Attributes And FileAttrDirectory Then
Debug.Print "DIR DI[[R]] : " & path
Set sfs = path.subFolders
For Each sf In sfs