0

我分三步编写宏脚本:

通过浏览读取 excel 文件 - 转换为 xml 格式 - 通过浏览将 xml 文件导出到特定路径。我知道如何通过浏览导出。

Set objShell = CreateObject("Shell.application")
Set objFolder = objShell.BrowseForFolder(0, "choose the path you want to export the xml file", 0, 0)

但这一个是browseforfolder。

如何浏览文件?如果我想通过浏览导入excel数据?

谢谢

4

1 回答 1

2

要打开“打开文件”对话框,我使用以下命令:

FileOpenName = Application.GetOpenFilename(fileFilter:="All files (*.*), *.*")

然后你将需要以下来打开文件

Open FileOpenName For (Binary|Write) as #1
   'Do writing operations here
Close #1
于 2012-09-11T09:13:58.713 回答