ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Folder dialog box (https://www.excelbanter.com/excel-programming/422755-open-folder-dialog-box.html)

Brad

Open Folder dialog box
 
Thanks for taking the time to read my question.

I would like to run some code that asks the user to selet the folder to look
in, and the standard dialog box opens that shows the file system on the PC.
I've done this before but can't find me code!!!

Any help would be great,

Thanks,

Brad

Ron de Bruin

Open Folder dialog box
 
Hi Brad

Try this for a folder
If you want to select files then post back

Sub test()
Dim oApp As Object
Dim oFolder As Variant

Set oApp = CreateObject("Shell.Application")

'Browse to the folder
Set oFolder = oApp.BrowseForFolder(0, "Select folder", 512)
If Not oFolder Is Nothing Then
MsgBox "You select this folder : " & oFolder.Self.Path
End If

End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Brad" wrote in message ...
Thanks for taking the time to read my question.

I would like to run some code that asks the user to selet the folder to look
in, and the standard dialog box opens that shows the file system on the PC.
I've done this before but can't find me code!!!

Any help would be great,

Thanks,

Brad


royUK[_103_]

Open Folder dialog box
 

See 'Browse For Folder'
(http://www.cpearson.com/excel/BrowseFolder.aspx)


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52892


Brad

Open Folder dialog box
 
Perfect,

Thanks so much.

Brad

"Ron de Bruin" wrote:

Hi Brad

Try this for a folder
If you want to select files then post back

Sub test()
Dim oApp As Object
Dim oFolder As Variant

Set oApp = CreateObject("Shell.Application")

'Browse to the folder
Set oFolder = oApp.BrowseForFolder(0, "Select folder", 512)
If Not oFolder Is Nothing Then
MsgBox "You select this folder : " & oFolder.Self.Path
End If

End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Brad" wrote in message ...
Thanks for taking the time to read my question.

I would like to run some code that asks the user to selet the folder to look
in, and the standard dialog box opens that shows the file system on the PC.
I've done this before but can't find me code!!!

Any help would be great,

Thanks,

Brad



Supattra Klomsontorn

Hi BradTry this for a folderIf you want to select files then postbackSub
 
Thank you very much

It's very useful ^^

On Wednesday, January 21, 2009 10:41 AM Bra wrote:


Thanks for taking the time to read my question.

I would like to run some code that asks the user to selet the folder to look
in, and the standard dialog box opens that shows the file system on the PC.
I've done this before but can't find me code!!!

Any help would be great,

Thanks,

Brad



On Wednesday, January 21, 2009 10:50 AM Ron de Bruin wrote:


Hi Brad

Try this for a folder
If you want to select files then post back

Sub test()
Dim oApp As Object
Dim oFolder As Variant

Set oApp = CreateObject("Shell.Application")

'Browse to the folder
Set oFolder = oApp.BrowseForFolder(0, "Select folder", 512)
If Not oFolder Is Nothing Then
MsgBox "You select this folder : " & oFolder.Self.Path
End If

End Sub



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Brad" wrote in message ...



On Wednesday, January 21, 2009 10:51 AM royUK wrote:


See 'Browse For Folder'
(http://www.cpearson.com/excel/BrowseFolder.aspx)


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52892



On Wednesday, January 21, 2009 11:11 AM Bra wrote:


Perfect,

Thanks so much.

Brad

"Ron de Bruin" wrote:



Submitted via EggHeadCafe
ASP.NET Drawing a chart using OWC11 - Office Web Components
http://www.eggheadcafe.com/tutorials...omponents.aspx



All times are GMT +1. The time now is 09:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com