更新时间:2023-09-26 11:58:28
使用Application.FileDialog对象
Use the Application.FileDialog object
Sub SelectFolder()
Dim diaFolder As FileDialog
' Open the file dialog
Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
diaFolder.AllowMultiSelect = False
diaFolder.Show
MsgBox diaFolder.SelectedItems(1)
Set diaFolder = Nothing
End Sub