The attached function returns a string containing the file path of the selected file.
I am getting a "Subscript Out of Range Error in the calling procedure in the second line of the following calling code. When I used a debug.print statement after the first line, the correct file was being called. I am running Excel 2003
strSourceFilePath = GetFile
Public Function GetFile() As String
.InitialFileName = Application.DefaultFilePath & "\"
.Title = "Please select source file"
If .SelectedItems.Count = 0 Then
GetFile = "No File Selected"
GetFile = .SelectedItems(1)