Sub Test()
Dim FilePath As String
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    .Title = "Folder to Run All Virtual Trader Vs GL Reconciliation"
    If .Show <> -1 Then
        umsg = "No Folder Selected to Start Balance Sheet Reconciliation"
        GoTo endFunction
    End If
    FilePath = .SelectedItems(1)
End With
FilePath = Dir(FilePath & "\*.xlsx*")
Do While Len(FilePath) > 0
    Debug.Print FilePath
    FilePath = Dir
Loop
'FilePath = Dir("E:\Dropbox\Excel\VBA TO EXCEL\*home*")
endFunction:
End Sub
Sub All_File_From_Folder()
Dim fso As Object
Dim fso_Folder As Object
Dim fso_file As Object

Set fso = CreateObject("Scripting.FileSystemObject") ' Created my Environment to write script
Set fso_Folder = mycomputer.GetFolder("F:\Rajan\Contacts\")
   
For Each fso_file In fso_Folder.Files
    Debug.Print fso_file
Next

End Sub

Sub folderpicker()
Dim obj_file
'Multiple Folders
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    .Show
    For i = 1 To .SelectedItems.Count
        fpath = .SelectedItems(i)
    Next
End With

'From Single Folder
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    If .Show <> -1 Then
        umsg = "No Folder Selected"
        GoTo endfunction
    End If
    fpath = .SelectedItems(1)
End With
fpath = "E:\Dropbox\Excel"
'Deal With all files
Set obj_fso = CreateObject("Scripting.FileSystemObject")
Set obj_folder = obj_fso.GetFolder(fpath)
'
For Each obj_subfolder In obj_folder.SubFolders
   Debug.Print obj_subfolder.Name
Next
'
For Each obj_subfolder In obj_folder.SubFolders
   For Each obj_file In obj_subfolder.Files
        If obj_fso.GetExtensionName(obj_file) = "GLI" Then
        End If
        Debug.Print obj_file.Name
    Next
Next

endfunction:
Set obj_file = Nothing
Set obj_subfolder = Nothing
Set obj_folder = Nothing
Set obj_fso = Nothing
End Sub
Sub LoopThroughFiles()
    Dim StrFile As String
    StrFile = Dir("E:\Dropbox\Excel\VBA TO EXCEL\*home*")
    Do While Len(StrFile) > 0
        Debug.Print StrFile
        StrFile = Dir
    Loop
End Sub