Changing default directory to a network directory.


Posted by Dominik Wells on November 23, 2001 8:40 AM

I would like to set up the default directory, much like using the

ChDir ("C:\Local folders\Local subfolders\")

but using a folder on the network

ChDir ("\\Network\Network folders\network subfolders\"

I am trying to use this as a prerequisite to the following command:

File_Name = Application.GetOpenFilename(FileFilter:="All Files (*.*),*.*", _
Title:="Select Input Text Data File")

Any help is greatly appreciated.

Posted by Bib on November 23, 2001 9:28 AM


Try this :

Sub MySub()

dim currentDefaultFilePath as string

currentDefaultFilePath = Application.DefaultFilePath

Application.DefaultFilePath = "\\Network\Network folders\network subfolders\"

...your code here...

Application.DefaultFilePath = currentDefaultFilePath

End Sub



Posted by Dominik Wells on November 23, 2001 11:11 AM

Sorry, it didn't work. Thanks for the suggestion, though - it worked in a different portion of my code!