J
JR_06062005
I want the user to click on a button in a spreadsheet, select a workbook and
open it. In order to do this, I created a dialogue to get the file name and
path. What I would like is for the dialogue box to open to a designated
location. To do this I tried the following code:
Dim FileName as string, Path as string
Path="C:\New Documents"
Application.SetDefaultPath=Path
FileName = Application.GetOpenFileName("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:= FileName
The problem is the dialogue always opens to "My Documents" and ignores the
Set Default Path. On the Application.SaveAsFileName method, there is a
setting called Initial Filename which allows me to set the initial path. Is
there a way to set the path so that the Open File dialogue opens to a
particualar location?
open it. In order to do this, I created a dialogue to get the file name and
path. What I would like is for the dialogue box to open to a designated
location. To do this I tried the following code:
Dim FileName as string, Path as string
Path="C:\New Documents"
Application.SetDefaultPath=Path
FileName = Application.GetOpenFileName("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:= FileName
The problem is the dialogue always opens to "My Documents" and ignores the
Set Default Path. On the Application.SaveAsFileName method, there is a
setting called Initial Filename which allows me to set the initial path. Is
there a way to set the path so that the Open File dialogue opens to a
particualar location?