[VBA ] 請問如何用VBA解壓縮gz檔

看板Visual_Basic作者 (= =)時間13年前 (2012/11/16 23:35), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
小弟有在網路上找到一段code 可以解壓縮.zip格式 但是無法解壓縮到.gz格式 錯誤在oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items 這行程式 弄了好久 實在弄不出來 請各位先進幫幫忙 指點一下小弟 Sub Unzip1() Dim FSO As Object Dim oApp As Object Dim Fname As Variant Dim FileNameFolder As Variant Dim DefPath As String Dim strDate As String Fname = "D:\xampp-win32-1.8.1-VC9.zip" If Not (Fname = False) Then DefPath = "D:\" If Right(DefPath, 1) <> "\" Then DefPath = DefPath & "\" End If strDate = Format(Now, " dd-mm-yy h-mm-ss") FileNameFolder = DefPath & "MyUnzipFolder " & strDate & "\" MkDir FileNameFolder Set oApp = CreateObject("Shell.Application") oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items On Error Resume Next Set FSO = CreateObject("scripting.filesystemobject") FSO.deletefolder Environ("Temp") & "\Temporary Directory*", True End If End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 180.177.13.161

11/17 00:28, , 1F
抓gzip來裝再用shell()執行不就解開了
11/17 00:28, 1F
文章代碼(AID): #1GfbqnTt (Visual_Basic)