I am trying to prevent the user from changing directories when I call getopenfilename. This sort of works:
I am thinking if instead of using CurDir here:
I use sfullPath - Filename, I will get what I am looking for. Anyone know how to do that?
Code:
10: Dim sFullPath As String
Dim Force As String
ChDir ThisWorkbook.Path
ChDir ".\..\" & "Patient Files"
Force = CurDir
sFullPath = Application.GetOpenFilename("Excel Files (*.xl*)," & _
"*.xl*", 1, "Select Patient File", "Open", False)
If Force <> CurDir Then
MsgBox "Invalid selection.", vbOKOnly + vbCritical, "Reports to Go..."
GoTo 10
End If
I am thinking if instead of using CurDir here:
Code:
If Force <> CurDir Then
I use sfullPath - Filename, I will get what I am looking for. Anyone know how to do that?