Rem 选择文件夹
Public Sub SG_BrowseForFolder()
'** 使用Shell.Application对象来选择文件夹
Dim objShell
Dim objFolder
Dim strPath As String
Set objShell = CreateObject("Shell.Application")
'** 显示选择文件夹对话框
Set objFolder = objShell.BrowseForFolder(0, "选择文件目录", 0, 0)
If Not objFolder Is Nothing Then '** 用户选择了文件夹
strPath = objFolder.self.Path
Else
strPath = ""
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub
【SolidWorks宏】选择文件夹
最新推荐文章于 2024-03-16 11:43:46 发布