Or simply use the API. Paste this into a module and run TestIt
Option Explicit
Private Declare Function SHBrowseForFolder Lib "shell32" (lpBrowseInfo As
BROWSEINFO) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal PIDL As
Long, ByVal lpstrBuffer As String) As Long
Private Declare Function GetActiveWindow Lib "USER32" () As Long
Private Type BROWSEINFO
hWnd As Long
lpcItemIDList As Long
lpstrDisplayName As String
lpstrTitle As String
uFlags As Long
bffCallBack As Long
lParam As Long
iImage As Integer
End Type
Private Const BIF_RETURNONLYFSDIRS = &H1
Public Sub SelectFolder( _
ByVal istrTittel As String, _
ByRef ustrFolder As String)
Dim Folder As BROWSEINFO
Dim myPIDL As Long
Dim sBuffer As String
Dim sEmptyString As String
sEmptyString = Space(255)
Folder.hWnd = GetActiveWindow
Folder.lpstrDisplayName = sEmptyString
Folder.lpstrTitle = istrTittel
Folder.uFlags = BIF_RETURNONLYFSDIRS
myPIDL = SHBrowseForFolder(Folder)
sBuffer = sEmptyString
SHGetPathFromIDList myPIDL, sBuffer
ustrFolder = Trim(Left$(sBuffer, Len(Trim(sBuffer)) - 1))
End Sub
Sub TestIt()
Dim strFolder As String
SelectFolder "Select folder", strFolder
MsgBox strFolder
End Sub