Morning,

I have the following code below that prompts a user to select a file from the active workbook drive and directory. However, when the active workbook is placed on a network drive, runtime error '5' comes up. Or alternatively, if Chdrive/Chdir is removed, the code can be run, but the default location for the user prompt is set to where the last open file location was. Id like the default user prompt directory to either be the current directory of where this workbook is placed on the network, or specified in the code as '//network/share' as this location does not change.

Can anyone help with this? Thanks in advance!

Sub Data()
 Dim fn As String
    Application.ScreenUpdating = False
    ChDrive ThisWorkbook.Path
    ChDir ThisWorkbook.Path
    fn = Application.GetOpenFilename("Excel Files,x.xls")
    If (fn = "False") + (fn = ThisWorkbook.FullName) Then Exit Sub



---my code to pull data---

End Sub