Getopenfilename method on mac: looping into folders

%3CLINGO-SUB%20id%3D%22lingo-sub-2153643%22%20slang%3D%22en-US%22%3EGetopenfilename%20method%20on%20mac%3A%20looping%20into%20folders%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2153643%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIm%20trying%20to%20run%20this%20code%20on%20my%20mac%20in%20order%20to%20loop%20through%20folders.%20However%2C%20it%20runs%20into%20an%20error%20all%20the%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20code%20Im%20trying%20to%20run%20is%20very%20simple%3A%20it%20gets%20stucked%20on%20.Title%20line.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditionally%20would%20you%20know%20where%20can%20I%20find%20a%20specific%20subject%20with%20mac%20clarification%20in%20that%20areas%20that%20the%20code%20works%20differently%20on%20Mac%20than%20on%20Windows%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-visual%22%3E%3CCODE%3E%20Sub%20Loop_Inside_Folder()%0A%20Dim%20FileDir%20As%20String%0A%20%0A%20With%20Application.FileDialog(msoFileDialogFolderPicker)%0A%20%20%20%20.Title%20%3D%20%22Please%20select%20a%20folder%20%22%0A%20%20%20%20.ButtonName%20%3D%20%22Pick%20Folder%22%0A%20%20%20%20%20If%20.Show%20%3D%200%20Then%0A%20%20%20%20%20%20%20%20MsgBox%20%22Nothing%20was%20selected%22%0A%20%20%20%20%20%20%20%20Exit%20Sub%0A%20%20%20%20%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20FileDir%20%3D%20.SelectedItems(1)%0A%20%20%20%20%20%20%20%20MsgBox%20FileDir%0A%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%20%20End%20If%0A%20%20%20%20End%20With%0A%20%0A%20%0A%20End%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2153643%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Regular Visitor

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