the "Open" dialog default path...
I want to have the application.showOpenDialog (or similar) in excel to start in a predetermined folder. I'm having trouble because:
1 - The only method I found was to change the actual default path, which would not be a plus for a program
2 - Method 1 doesn't work (and I won't use it anyways), I recorded a macro of changing the filepath but apparently if I set it using code it doesn't "get through" to excel (maybe events were off?).
Does anyone know how to have it open where I want it to?
Re: the "Open" dialog default path...
You could just save the default path and then change it to where you need just before calling it. Then after
the file has been selected you can chage it back.
VB Code:
Dim sDefPath As String
'...
sDefPath = Application.DefaultFilePath
Application.GetOpenFilename("Text Files (*.txt), *.txt")
'Do your open stuff.
'...
'Set the path back.
Application.DefaultFilePath = sDefPath