How to change the default directory

  • Thread starter Thread starter Woody
  • Start date Start date
W

Woody

Hello,

I tried to change the default directory by the following setting:

ChDir "D:\My documents\toto\"

The I open a dilog box to select a file in this default directory with the
following procedure:

Dim oDialog As Office.FileDialog
Set oDialog = XLApp.FileDialog(msoFileDialogFilePicker)
oDialog.Filters.Add "Fichiers Excel", "*.xls"
oDialog.Title = "Sélectionnez le fichier Excel"
oDialog.AllowMultiSelect = False
oDialog.Show

But this dialog remains opened on "My documents" and not on "D:\My
documents\toto\"
What am I missing ?
Thanks for your help

Woody
 
ChDrive "D:\My documents\toto\"
ChDir "D:\My documents\toto\"


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thanks Bob, but with this FileDialog(msoFileDialogFilePicker) dialog, these
ChDrive et ChDir settings do not work for me ;-(

Any other idea?
 
Thanks a lot Papou,

I transfer here the french ng answer:
It's a property of this dialog : InitialFileName

Set oDialog = XLApp.FileDialog(msoFileDialogFilePicker)
oDialog.InitialFileName = "D:\My documents\Toto\"

Woody
 

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

Back
Top