Sub getFile()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
Dim File_Name
With fd
.AllowMultiSelect = False
If .Show = -1 Then
File_Name = .SelectedItems(1)
MsgBox File_Name
Else
End If
End With
Set fd = Nothing
End Sub
This can be used this way............in VBA
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & File_Name,Destination:=Range("$A$1"))
.Name = Project1"
.FieldNames = True ..........