以下示例代码展示如何调用系统的文件夹选择对话框: Private Function SelectFolder(ByVal Describe As String, Optional ByVal ShowNewFolder As Boolean = True) As String Using nOpen As New System.Windows.Forms.FolderBrowserDialog() nOpen.Description = Describe nOpen.ShowNewFolderB
VBA调用InternetExplorer操作IE浏览器,自动弹出文件选择对话框时,VBA会处于阻塞状态,你必须手工关闭文件选择对话框,VBA才能继续向后运行. 例如下面网址,就有一个文件浏览按钮: http://www.zytxs.com/web1/upload.aspx 我做了一个exe文件,可以在另一个进程中来处理文件对话框. Sub Test() Dim File As MSHTML.HTMLInputFileElement Dim WSH As Object Set File = IE