Dim InitialPathName As String InitialPathName = "C:\000_fileDB_attach" ' ^^^ set initialfolder If Getfileattr(InitialPathName) = 16 Then '^^^ check if initial folder is really a folder Dim fileName As String ' The Filename Dim FolderArray() As Variant ' The Array with all folders Dim FolderCounter As Long ' The FolderCounter FolderCounter = 0 ' set initial number Dim CurrentFileName As String ' create curent filename to work with Redim Preserve FolderArray(FolderCounter) ' redim dyn. array FolderArray(FolderCounter) = InitialPathName Dim index As Long index = 0 While index <= FolderCounter ' get the index from the array where the foldercounter points on fileName = Dir$(FolderArray(index)+"\*.*",16) Do While fileName <> "" CurrentFileName = FolderArray(index)+"\"+fileName ' ^^^ set current filename If Getfileattr(CurrentFileName) = 16 And Not filename = "." And Not filename = ".." Then ' If the currentFileName is a Folder do this here... FolderCounter = FolderCounter +1 Redim Preserve FolderArray(FolderCounter) FolderArray(FolderCounter) = FolderArray(index)+"\"+fileName '^^^ if we have a folder in the fileName Var. then add it to the array End If fileName = Dir$() Loop index = index + 1 Wend Else Print "I´m sorry but the InitialPathName must be a folder" End If