title: VBA in Excel Run Time Error 13: Type Mismatch
body: <p>I'm trying to open a file dialog box in excel so a user can select a file. For some reason I keep getting a run time error after I've selected the file I want. Here is the code:</p>
  
  <pre><code>Dim dartFile As String
  
  dartFile = Application.GetOpenFilename _
  (Title:="Please choose DART output to open", _
  FileFilter:="Excel Files *.xlsx* (*.xlsx*),")
  
  If dartFile = False Then
      MsgBox "No file selected.", vbExclamation, "Sorry!"
      Exit Sub
  Else
      'Run the rest of the Sub
  End IF
  </code></pre>
  
  <p>The error pops up when ever I select a valid .xlsx file, and the debugger says there is something wrong with this line:</p>
  
  <pre><code>If dartFile = False Then
  </code></pre>
  
  <p>Any help would be appreciated.</p>