title: Excel file dialog box appearing multiple times
body: <p>I am using <code>Application.FileDialog(msoFileDialogOpen)</code> to allow a user to select a file to import data from. However, after the user selects a file it pops open the file dialog box again asking them to choose a file. It will do this 2-3 times before it continues on.</p>
  
  <p>Have I accidentally created a loop?</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Set myFile = Application.FileDialog(msoFileDialogOpen)
  
  With myFile
      .Title = "Choose File"
  
      .AllowMultiSelect = False
  
      If .Show &lt;&gt; -1 Then
         Exit Sub
         ElseIf .Show &lt;&gt; 0 Then
         FileSelected = .SelectedItems(1)
      End If
  End With
  
  'data location &amp; range to copy
  
  mydata = "='[FileSelected]'!$C$10:$C$21" '&lt;&lt; change as required
  
  'link to worksheet
  With ThisWorkbook.Worksheets(1).Range("C10:C21") '&lt;&lt; change as required
  .Formula = mydata
  'convert formula to text
  .Value = .Value
  
  End With
  End Sub
  </code></pre>
  
  <p>So I have tried each of your solutions, and I am still getting two open file dialog boxes, however there is a difference between the two that I didn't notice before. the first box has the appropriate "Choose File" title, however the second box has "Update Values: FilesSelected" for the title. I also have added the last few lines that I excluded before. Thanks again for all your help.  </p>