title: Coding works in Windows OS but not in Mac OS( Run time error 1004)
body: <p>Using it for fetching excel file from specific folder. 
  It is working in windows OS but not in Mac OS.
  How to make it cross plate form? Pls help.    </p>
  
  <pre><code> Sub getfilename()
   Dim objFSO As Object
  Dim intCountRows As Integer
  Application.FileDialog(msoFileDialogFolderPicker).Title = _
  "Select a Path"
  intResult = Application.FileDialog( _
  msoFileDialogFolderPicker).Show
  If intResult &lt;&gt; 0 Then
      strpath = Application.FileDialog(msoFileDialogFolderPicker _
      ).SelectedItems(1)
      Set objFSO = CreateObject("Scripting.FileSystemObject")
  ThisWorkbook.Activate
  Sheets("dropdown").Select
  Range("q2").Value = strpath
  End If
  Dim objFolder As Object
  Dim objFile As Object
  Dim i As Integer
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFolder = objFSO.GetFolder(strpath)
   ThisWorkbook.Activate
  Sheets("dropdown").Activate
  Range("aa3:aa2000").Clear
  i = 1
  For Each objFile In objFolder.Files
      Filename = objFile.Name      
       Range("aa1000").Select
      Selection.End(xlUp).Select
      ActiveCell.Offset(1, 0).Select
      Application.ActiveCell = Filename
   Next objFile
  End Sub
  </code></pre>