Если хотите сделать всё с помощью своих рук, то код будет немного побольше, но зато не придется прибегать к массивным инструментам OCX и DLL библиотекам, а уж тем более к средствам AutoLisp.
Вот что такое Windows API:
Private Type BrowseInfo
hwndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Dim FolderDialogTitle As String
Dim ShowDirsOnly As Boolean
Dim hwndOwner As Long
Sub ВыбратьДиректорию()
hwndOwner = Me.hWnd
FolderDialogTitle = "Select Directory"
ShowDirsOnly = True
MsgBox ShowFolder
End Sub
Function ShowFolder() As String
Dim lRes As Long
Dim sTemp As String
Dim iPos As Integer
Dim bi As BrowseInfo
With bi
.hwndOwner = hwndOwner
.lpszTitle = lstrcat(FolderDialogTitle, "")
.ulFlags = Abs(ShowDirsOnly)
End With
lRes = SHBrowseForFolder(bi)
If lRes Then
sTemp = String(MAX_PATH, vbNullChar)
SHGetPathFromIDList lRes, sTemp
CoTaskMemFree lRes
iPos = InStr(sTemp, vbNullChar)
If iPos Then sTemp = Left(sTemp, iPos - 1)
End If
ShowFolder = sTemp
End Function