• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

GUI for user to specify a new directory?

ErikG

New Member
Hi All!

Just like the Application.GetSaveAsFilename() method allows users to specify an excel file that does not yet exist through a GUI dialog (It returns a string with the path and filename that the code then creates by saving a file), I would like to offer users a similar GUI/dialog to to specify a directory (that may not yet exist) that would receive output from several different sub-routines.

I tried the GetSaveAsFilename method but it would not let me specify a directory and Application.FileDialog limited me to existing directories. Does anyone know of a way to generate this functionality?

Many thanks in advance!!

Erik G
 
Hi !​
Code:
Sub DemoFolder()
    Dim obj As Object, P$
    Set obj = CreateObject("Shell.Application").BrowseForFolder(0, vbLf & "Sélection :", 1, "")
     If obj Is Nothing Then Beep: Exit Sub Else P = obj.Self.Path & "\": Set obj = Nothing
    MsgBox P
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top