LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default File Open Dialogue Box to a Specified Location

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?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to ask for file location and use to open DB Brian Excel Worksheet Functions 4 May 15th 09 03:36 PM
Sort order in File Open dialogue box Roberto Excel Discussion (Misc queries) 1 December 12th 05 12:44 AM
In Excel, a dialogue box comes up and says "unable to open file". GailS Excel Discussion (Misc queries) 0 August 17th 05 04:33 PM
Open file dialogue box Tinsu Excel Programming 1 April 16th 04 01:29 AM
Opening Open File Dialogue box from Excel97 Scampa7[_5_] Excel Programming 0 November 19th 03 08:34 PM


All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"