A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I am retired several years now, so I don't have access to a network system to test this, but the documentation I have read seems to indicate this code will work for local and network drives, but you will have to test that for yourself. The code makes use of a function that returns the drive letter or network drive designation. This is the function...
Function GetDriveLetter(Path As String) As String
Dim FS As Object, Drv As Object
Set FS = CreateObject("Scripting.FileSystemObject")
Set Drv = FS.GetDrive(FS.GetDriveName(Path))
GetDriveLetter = Drv.DriveLetter
End Function
and here is the code (it replaces my previously posted code) that does all the work, calling the above function as needed...
Dim OldDir As String, OldDrive As String, DefaultPath As String
DefaultPath = "D:\Original Files\Documentation\ENG"
OldDrive = GetDriveLetter(CurDir)
OldDir = CurDir
ChDrive GetDriveLetter(DefaultPath)
ChDir DefaultPath
Application.GetOpenFilename
ChDrive OldDrive
ChDir OldDir