I have this code that I have been using to allow the user to open a workbook within a specific folder:
I am looking to add an If/Then statement right after this code that tests to see if the file the user tries to open is from another directoy and if so prevent them.
Is there a way to do that?
Code:
10: Dim sFullPath As String
ChDir ThisWorkbook.Path
ChDir ".\..\" & "Patient Files"
sFullPath = Application.GetOpenFilename("Excel Files (*.xl*)," & _
"*.xl*", 1, "Select Patient File", "Open", False)
I am looking to add an If/Then statement right after this code that tests to see if the file the user tries to open is from another directoy and if so prevent them.
Is there a way to do that?