[VBA] 打开文件夹

 1 '显示打开文件夹对话框
 2 With Application.FileDialog(msoFileDialogFolderPicker)
 3 .Show
 4 If .SelectedItems.Count = 0 Then Exit Sub '未选择文件夹
 5 strFolder = .SelectedItems(1)
 6 End With
 7  
 8 '获取文件夹中的所有文件列表
 9 varFileList = fcnGetFileList(strFolder)
10  
11 If Not IsArray(varFileList) Then
12 MsgBox "未找到文件", vbInformation
13 Exit Sub
14 End If

 

posted @ 2013-06-17 10:06  Zoe_J  阅读(1072)  评论(0编辑  收藏  举报