Is there a way to designate the starting directory for GetOpenFileName ?
The online VBA help only says you can designate a File Filter.
TIA
Is there a way to designate the starting directory for GetOpenFileName ?
The online VBA help only says you can designate a File Filter.
TIA
Hello Bhofsetz,
Use the VBA command ChDir to set the default directory. Specifiy the disk and path you want as a string.
Example:
The current directory setting is C:\My Documents
This will change the default directory for Windows to...
ChDir("D:\My Files\Excel Programs")
Hope this answers your question,
Leith Ross
Thank Leith that was exactly what I was looking for.
I added an
On Error Resume Next
line just before the ChDir command line that ends up taking you to the last directory used if the directory specified in ChDir is not avalialbe (i.e. a network drive that is no longer valid).
Does anyone know if I may be setting myself up for trouble by using the
On Error Resume Next
in this way?
Thanks again
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks