Sub TestGetFile()
Dim nIndex As Integer
Dim sFile As String
sFile = GetExcelFile("Testing GetExcelFile Function")
If sFile = "False" Then
Debug.Print "No file selected."
Exit Sub
End If
Debug.Print sFile
End Sub
Function GetExcelFile(sTitle As String) As String
Dim sFilter As String
Dim bMultiSelect As Boolean
sFilter = "Workbooks (*.xls), *.xls"
bMultiSelect = False
GetExcelFile = Application.GetOpenFilename(FileFilter:=sFilter, _
Title:=sTitle, MultiSelect:=bMultiSelect)
End Function
|