File Dialog Folder Picker open to particular folder

K

KeriM

I'm currently usin
"Application.FileDialog(msoFileDialogFolderPicker).Show" to have th
user open a folder. When that dialog pops up, it automatically opens t
the last folder that was opened. I'd like it to always open to the sam
root folder, so the user can select the correct folder from there. I
there a way to specify this? I've tried putting a change director
command before the file dialog code, but that didn't do anything.

Just fyi:

All of my folders are on a network path.

I usually use this to nativate to my network path:

Code
-------------------

Sub ChDirNet(szPath As String)
Dim lReturn As Long
lReturn = SetCurrentDirectoryA(szPath)
If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path."
End Sub
'Use this when I want to change directories in my code:
ChDirNet("my file path")
 
B

Ben McClave

Keri,

Have you tried this?

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\Desktop"
.Show
End With
 
K

KeriM

Ben said:
Keri,

Have you tried this?

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\Desktop"
.Show
End With

Thank you! That worked perfectly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top