Application.filedialog--- default directory

G

Guest

I'm using the application.filedialog method to get a file. I want to set the
default directory where this dialog opens up... any ideas??

(*** I tried
chdrive "C:"
then
chdir "C:\whatever")

didn't seem to work
 
D

David Lloyd

Tom:

One approach is to use the InitialFileName property of the FileDialog object
and set it equal to the directory without specifying an actual filename.
For example:

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)

fd.InitialFileName = "h:\Program Files"
fd.Show

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I'm using the application.filedialog method to get a file. I want to set
the
default directory where this dialog opens up... any ideas??

(*** I tried
chdrive "C:"
then
chdir "C:\whatever")

didn't seem to work
 

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