title: Excel import from CSV by VBA from prompted location
body: <p>I try to import a csv file by VBA. The file is always called data.csv, but it can be in different folders. Therefore, this code first prompts the path, then makes <em>file</em> the file location, but there is nothing imported. What is wrong?</p>
  
  <p>JV</p>
  
  <pre><code>Sub View()
  
  'Prompts Path
  Application.FileDialog(msoFileDialogFolderPicker).Show
  Path = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1)
  
  'Defining file
  File = Path &amp; "\data.csv"
  
  Workbooks.Add
  
  With ActiveSheet.QueryTables.Add(Connection:= _
      "TEXT;" &amp; File, _
      Destination:=Range("A1"))
      .TextFileTabDelimiter = True
      .TextFileDecimalSeparator = "."
  End With
  
  End Sub
  </code></pre>