|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
网上找到的代码,最后一句未通过,不知错在哪里:
Sub Unzipper()
Dim command As String, wsh As Object, waitOnReturn As Boolean, windowStyle As Integer
Dim pdfPath As String, zipPath As String
waitOnReturn = True
windowStyle = 7
zipPath = "D:\Downloads\test.zip" 'frmMerge.txtBoxFile2.Value
pdfPath = "D:\Downloads\" 'ThisWorkbook.Path & "\PDFTemp\"
command = "Powershell Expand-Archive -LiteralPath " & _
"'" & zipPath & "' -DestinationPath '" & pdfPath & "'"
Set wsh = VBA.CreateObject("WScript.Shell")
wsh.Run command, windowStyle, waitOnReturn '不知是否未装ZIP,执行未通过!
End Sub
|
|