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 Folder Help required

I was wondering if VBA as a method that allows you to open a folder directly
use the Open File Dialog.
For example if I use this code:
Application.GetOpenFilename("Text Files (*.txt), *.txt")
I want aspecific folder to be opened in the Open file dialog.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Open Folder Help required

Give this a try...

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\" 'Specify folder path
If .Show = -1 Then
'do it
Else
'don't do it
End If
End With

Helpful advice here...
http://www.cpearson.com/excel/newposte.htm

--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Ayo"
wrote in message
I was wondering if VBA as a method that allows you to open a folder directly
use the Open File Dialog.
For example if I use this code:
Application.GetOpenFilename("Text Files (*.txt), *.txt")
I want aspecific folder to be opened in the Open file dialog.
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Open Folder Help required

Thanks a million Jim. This is exactly wjat I was look for. Thank you very much.

"Jim Cone" wrote:

Give this a try...

With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\" 'Specify folder path
If .Show = -1 Then
'do it
Else
'don't do it
End If
End With

Helpful advice here...
http://www.cpearson.com/excel/newposte.htm

--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Ayo"
wrote in message
I was wondering if VBA as a method that allows you to open a folder directly
use the Open File Dialog.
For example if I use this code:
Application.GetOpenFilename("Text Files (*.txt), *.txt")
I want aspecific folder to be opened in the Open file dialog.

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
Calculations did not find required folder KCK Excel Discussion (Misc queries) 1 April 17th 09 07:07 PM
User selection of folder and open all .xls files within folder Barb Reinhardt Excel Programming 4 April 14th 07 01:41 PM
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 02:02 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"