【发布时间】:2014-02-02 02:30:11
【问题描述】:
下面的代码使用 winzip 解压缩一个 .zip 文件。但是,如果 FolderPath 包含空白,我会收到不可捕获的错误“无法打开文档。”,没有错误号。如果 FolderPath 包含空白,如何使用 Shell 解压缩此文件?谢谢,
FolderPath = ThisWorkbook.Path & "\"
Unzipfile = Dir(FolderPath & "*.zip")
While UnzipFile <> ""
if InStr(1, UnzipFile, ".zip") > 0 Then
ShellStr = "C:\Program Files\WinZip\winzip32 e- " & FolderPath & UnzipFile & " " & FolderPath
Call Shell(ShellStr, vbHide)
【问题讨论】: