Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Open a folder

I am trying to find if VBA has a utility that makes it possible to set the
Open File Dialog to a specific folder.
For example, if I use this code
Application.GetOpenFilename("Text Files (*.txt), *.txt")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Open a folder

Hi Ayo,

See if the following example helps. However I have not tested it with your
specific requirement.

Sub Return_Set_Path()

'Return the current default file path
MsgBox Application.DefaultFilePath

'Set the default file path
'Note:The following resets the default file path
'to save/open all Excel files as if it has been set in options.

strpath = Application.DefaultFilePath & "\Test"
Application.DefaultFilePath = strpath
MsgBox Application.DefaultFilePath

End Sub

Regards,

OssieMac

"Ayo" wrote:

I am trying to find if VBA has a utility that makes it possible to set the
Open File Dialog to a specific folder.
For example, if I use this code
Application.GetOpenFilename("Text Files (*.txt), *.txt")

Reply
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
User selection of folder and open all .xls files within folder Barb Reinhardt Excel Programming 4 April 14th 07 01:41 PM
VBA - open folder Jeff Excel Discussion (Misc queries) 1 March 23rd 07 01:33 AM
Help: Can open a spreadsheet in a folder which contains spaces in the folder name! 1tsols Excel Programming 17 July 31st 06 04:26 PM
open file from folder save in new folder tim64[_3_] Excel Programming 20 June 17th 05 07:58 PM
Open files in folder - skip if already open Steph[_3_] Excel Programming 6 March 25th 05 06:49 PM


All times are GMT +1. The time now is 04:16 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"