使用Shell对象的的方式获取选择的文件夹路径
Private Sub cmdDir_Click()
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "选择文件夹", 0, 0)
If Not objFolder Is Nothing Then
txtDir.Text = objFolder.self.Path
Else
Exit Sub
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub