To import some file from computer to Excel it’s good idea to use File Picker to import data to our file. There is no need to make rigid connection in sheet to data file.The solution is File Picker.
Following code allowed to pick file name and it’s path by selecting it in File Picker. Some extension filters might be added to find interesting file faster.
Sub SeelctFile() Dim fDialog As FileDialog, result As Integer Set fDialog = Application.FileDialog(msoFileDialogFilePicker) 'Optional: FileDialog properties fDialog.AllowMultiSelect = False fDialog.Title = "PLEASE SELECT A FILE.." 'fDialog.InitialFileName = "Computer" 'Optional: Add filters fDialog.Filters.Clear fDialog.Filters.Add "Microsoft Access DataBase", "*.mdb" fDialog.Filters.Add "All Files", "*.*" 'Show the dialog. -1 means success! If fDialog.Show = -1 Then Debug.Print fDialog.SelectedItems(1) End If End Sub