Getopenfilename method on mac: looping into folders

Copper Contributor

Hi!

 

Im trying to run this code on my mac in order to loop through folders. However, it runs into an error all the time.

 

The code Im trying to run is very simple: it gets stucked on .Title line. 

 

Additionally would you know where can I find a specific subject with mac clarification in that areas that the code works differently on Mac than on Windows?

 

Thanks,

 Sub Loop_Inside_Folder()
 Dim FileDir As String
 
 With Application.FileDialog(msoFileDialogFolderPicker)
    .Title = "Please select a folder "
    .ButtonName = "Pick Folder"
     If .Show = 0 Then
        MsgBox "Nothing was selected"
        Exit Sub
    
    Else
        FileDir = .SelectedItems(1)
        MsgBox FileDir
    
    
      End If
    End With
 
 
 End Sub

 

 

 

0 Replies