title: Excel VB Open File OSX and Windows
body: <p>I've got a spreadsheet that uses some basic code to get the user to select a file (txt file). It works flawlessly on Windows but fails on OSX obviously due to the difference in FileDialog calls. I've done some research though and can't seem to find much information about opening a File Dialog on both OSX and Windows for Excel/VB. </p>
  
  <p>The current code is, </p>
  
  <pre><code>FileToOpen = Application.GetOpenFilename _
  (Title:="Please choose a file to import", _
  FileFilter:="Excel Files *.xls (*.xls),")
  ''
  If FileToOpen = False Then
  MsgBox "No file specified.", vbExclamation, "Duh!!!"
  Exit Sub
  Else
  Workbooks.Open Filename:=FileToOpen
  End If
  </code></pre>