title: I want to open dialog window to search for Excel file and import
body: <p>The following code will look for text files but I am looking to have the same dialog box pop up using the folder location of my current file. How would I do this?</p>
  
  <p>fName = Application.GetOpenFilename("Text Files (*.txt), *.txt")</p>
  
  <p>If fName = "False" Then Exit Sub</p>
  
  <pre><code>With Sheets("data export").QueryTables.Add(Connection:="TEXT;" &amp; fName, _
      Destination:=Worksheets("data export").Range("$A$1"))
          .Name = "sample"
          .FieldNames = True
          .RowNumbers = True
          .FillAdjacentFormulas = False
          .PreserveFormatting = True
          .RefreshOnFileOpen = False
          .RefreshStyle = xlInsertDeleteCells
          .SavePassword = False
          .SaveData = True
          .AdjustColumnWidth = True
          .RefreshPeriod = 0
          .TextFilePromptOnRefresh = False
          .TextFilePlatform = 437
          .TextFileStartRow = 1
          .TextFileParseType = xlDelimited
          .TextFileTextQualifier = xlTextQualifierNone
          .TextFileConsecutiveDelimiter = True
          .TextFileTabDelimiter = False
          .TextFileSemicolonDelimiter = False
          .TextFileCommaDelimiter = False
          .TextFileSpaceDelimiter = False
          .TextFileOtherDelimiter = "" &amp; Chr(10) &amp; ""
          .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, _
             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
          .TextFileTrailingMinusNumbers = True
          .Refresh BackgroundQuery:=False
  End With
  </code></pre>