Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default Is there a Folder Picker method that shows files too?

If I'm doing this with a vbScript file, I typically use the
"Scripting.FileSystemObject" to retrieve an appropriate parent folder or
drive, depending on where I want to start. The "Shell.Application" object
does offer a number of options other than the MyDocuments folder if you want
to stick to what I've got.
Here is a link to info on getting the path to various special folders:
http://www.microsoft.com/technet/scr....mspx?mfr=true

For some good information on using BrowseForFolder (written for script
writers but easy to use in a VBA routine, check out:
http://wsh2.freeweb.hu/ch12f.html


Steve Yandl



"tenlbham" wrote in message
...
Excellent, that's almost it!!! Thanks.

Question: this current browser object doesn't appear to give me the
option
to go up to parent folders, is there a way to change that?

This is a different way of coding for me so I don't recognize how to
change
the various options. Although I did figure out that the "&H5" was a
reference to My Documents (as changing it to H0-H9 set the directory to
various locations), and "&H4001" is perhaps some sort of filter. I was
able
to get the browser to display NO files when I changed it to "&H1001"


"Steve Yandl" wrote:

Dim objShell
Dim objFldr

Set objShell = CreateObject("Shell.Application")
Set objMyDocs = objShell.Namespace(&H5)
pathMyDocs = objMyDocs.Self.Path

On Error Resume Next
Set objFldr = objShell.BrowseForFolder(0, "pick me", &H4001, pathMyDocs)

If Not (objFldr Is Nothing) Then
MsgBox objFldr.Items.Item.Path
End If

Set objFldr = Nothing
Set objShell = Nothing




"tenlbham" wrote in message
...
Thanks, but this is a file picker. I cannot use it to select a folder.






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
What is the best method to add a date picker to a spreadsheet? Paul Excel Discussion (Misc queries) 1 April 12th 07 02:36 AM
How can I clean the buffer from the folder picker? Excel 009 Excel Programming 22 October 3rd 06 04:22 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven[_2_] Excel Programming 1 January 24th 06 04:23 AM
Folder picker default - second attempt... pk Excel Programming 4 October 13th 03 05:42 PM
Folder picker: default to network share? pk Excel Programming 0 October 11th 03 04:48 PM


All times are GMT +1. The time now is 09:32 PM.

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

About Us

"It's about Microsoft Excel"