Hi Everyone,
the below could does direct me to the file, but when I click on the file, it does not open it? any ideas?
Option Explicit
Sub GetImportFileName()
Dim Filt As String
Dim FilterIndex As Integer
Dim FileName As Variant
Dim Title As String
' Set up list of file filters
Filt = "All Files (*.*),*.*"
' Display *.* by default
FilterIndex = 5
' Set the dialog box caption
Title = "Select a File to Import"
' Get the file name
FileName = Application.GetOpenFilename _
(FileFilter:=Filt, _
FilterIndex:=FilterIndex, _
Title:=Title)
' Exit if dialog box canceled
If FileName = False Then
MsgBox "Attention: No file was selected."
Exit Sub
End If
End Sub
the below could does direct me to the file, but when I click on the file, it does not open it? any ideas?
Option Explicit
Sub GetImportFileName()
Dim Filt As String
Dim FilterIndex As Integer
Dim FileName As Variant
Dim Title As String
' Set up list of file filters
Filt = "All Files (*.*),*.*"
' Display *.* by default
FilterIndex = 5
' Set the dialog box caption
Title = "Select a File to Import"
' Get the file name
FileName = Application.GetOpenFilename _
(FileFilter:=Filt, _
FilterIndex:=FilterIndex, _
Title:=Title)
' Exit if dialog box canceled
If FileName = False Then
MsgBox "Attention: No file was selected."
Exit Sub
End If
End Sub