title: Excel VBA Open File (error handling)
body: <p>I'm trying to account for a case when the user does not find a file to open:</p>
  
  <pre><code>Dim fn As String
  fn = Application.GetOpenFilename("All Files,.", 1, "Select a file", , False)
  
  If fn = False Then
      Exit Sub
  End If
  </code></pre>
  
  <p>This does what I want it to when a file is not chosen.</p>
  
  <p>But when the user <em>does</em> choose a file, this If statement creates an error. Can anyone tell me the proper way to accomplish this?</p>