ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to change the default directory (https://www.excelbanter.com/excel-programming/399745-how-change-default-directory.html)

Woody[_5_]

How to change the default directory
 
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 procedu

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



Bob Phillips

How to change the default directory
 
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)



"Woody" wrote in message
...
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 procedu

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





Woody[_5_]

How to change the default directory
 
Thanks Bob, but with this FileDialog(msoFileDialogFilePicker) dialog, these
ChDrive et ChDir settings do not work for me ;-(

Any other idea?


"Bob Phillips" a écrit dans le message de news:
...
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)



"Woody" wrote in message
...
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 procedu

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







papou[_3_]

How to change the default directory
 
Woody
See answers in microsoft.public.fr.Excel

Cordially
Pascal

"Woody" a écrit dans le message de news:
...
Thanks Bob, but with this FileDialog(msoFileDialogFilePicker) dialog,
these ChDrive et ChDir settings do not work for me ;-(

Any other idea?


"Bob Phillips" a écrit dans le message de news:
...
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)



"Woody" wrote in message
...
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 procedu

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









Woody[_5_]

How to change the default directory
 
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

"papou" a écrit dans le message
de news: ...
Woody
See answers in microsoft.public.fr.Excel

Cordially
Pascal

"Woody" a écrit dans le message de news:
...
Thanks Bob, but with this FileDialog(msoFileDialogFilePicker) dialog,
these ChDrive et ChDir settings do not work for me ;-(

Any other idea?


"Bob Phillips" a écrit dans le message de news:
...
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)



"Woody" wrote in message
...
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 procedu

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












All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com