View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Second run of macro hangs on .show of application.filedialog object!

I've always found this much more consistently reliable...

Function GetDirectory$(Optional OpenAt, Optional Msg$)
Dim SH As Object

If Msg = "" Then Msg = "Please choose a folder"
Set SH = CreateObject("Shell.Application").BrowseForFolder( 0, Msg,
&H40 Or &H10, OpenAt)

On Error Resume Next
GetDirectory = SH.Self.Path
On Error GoTo 0
Set SH = Nothing
End Function 'GetDirectory()

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion