Applicaition Default File Path

G

Greg Bloom

In Excel - my 'Default File Location' is C:\Data

In my VBA Code:
I set the Application.DefaultFilePath = "C:\OE"
I then set File_Name = Application.GetOpenFilename(filefilter:=Filt,
FilterIndex:=FilterIndex, Title:=Title)

But it always goes to the last data path that was used to open a file in
Excel. I can not get the new default path (C:\OE) to work in the the
GetOpenFileName.

Thanks
Greg Bloom
 
J

Jan Karel Pieterse

Hi Greg,
In my VBA Code:
I set the Application.DefaultFilePath = "C:\OE"
I then set File_Name = Application.GetOpenFilename(filefilter:=Filt,
FilterIndex:=FilterIndex, Title:=Title)

Use:

Chdrive("C:")
ChDir("C:\Data")
then do the getopenfilename

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 

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