I was able to sort of get it working another way:
Code:
Private Sub browseDataButton_Click()
Dim dlg As Office.FileDialog
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
dlg.Title = "Select Excel Spreadsheet to import"
dlg.AllowMultiSelect = False
If dlg.Show = -1 Then
dataPath = dlg.InitialFileName
MsgBox dlg.InitialFileName
Me!browseDataPath = dlg.InitialFileName
End If
End Sub
I'm able to get the directory where the file is, but does not append the name of the file to the directory.
For example if blabla.xls is on the C drive, MsgBox will popup "C:\".
How do I make popup "C:\blabla.xls" (or whatever the xls file may be for that matter)?
Thanks