Re: Excel VBA. Setting the default path for GetOpenFileName
- From: "Jon Peltier" <jonxlmvpNO@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Sep 2007 19:43:44 -0400
Use the following:
ChDrive "C"
ChDir "C:\Temp"
If you want to be nice to the user and change it back to what it was:
Dim sCurDir As String
Dim sOpenFileName As String
sCurDir = CurDir
ChDrive "C"
ChDir "C:\Temp"
sOpenFileName = Application.GetOpenFileName
ChDrive sCurDir
ChDir sCurDir
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______
to change the drive and directory to what you want.
"Balmain Bushwalker" <Balmain Bushwalker@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:49D0EB82-CDF4-44A3-9B1C-702754F615BC@xxxxxxxxxxxxxxxx
Excel VBA.
Setting 'Application.DefaultFilePath' before calling
'Application.GetOpenFileName' does not set the opening (default)
directory.
Anyone know how to do it?
.
- Prev by Date: Re: Set text color to interior color
- Next by Date: RE: What is the difference between for..if, case statements, do..while
- Previous by thread: What is the difference between for..if, case statements, do..while?
- Next by thread: Re: File size of web file via url
- Index(es):
Loading