View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] apj.jpcs@sympatico.ca is offline
external usenet poster
 
Posts: 1
Default Browse for folder - Jim Rech's

Desperation must be the mother of invention!
(This works for XL2000. I understand that the file picker dialog works
for XP and later.)

I tried "Application.GetSaveAsFileName", and found that I can use it to
return a file pathname combination without actually selecting a file.

Setting the initialfilename parameter(not available in
GetOpenFilename), in the call does the trick. When the dialog opens,
select a directory. Select "Save" and the dialog will drill down. To
select the directory that is displayed in the dialog path dropdown,
simply select a blank area in the body of the dialog. The dialog then
returns a string equal to the displayed path plus the name of the
initialfilename parameter! - the path can then be parsed out.

Dim DestPath
InitFileName = "Do Not Enter a Name Here"
uTitle2 = "Select SUNCOR Destination Directory for PDF Files"
DestPath =
Application.GetSaveAsFilename(initialfilename:=Ini tFileName,
Title:=uTitle2)

(This technique also allows all the functionality of the standard MS
dialog, favorites, create directory, etc.)

A little finicky, but simple enough.

Alex J