Unzip_7Zip

Extracts a zip into a location and waits for that extraction to finish
Using 7z (7za.exe found in attachment) to extract all files of a zip archive into certain folder.
7za,exe (found in attached zip) expected to be in a folder called "Resources" next to that workbook

Sub Unzip_7Zip(FullZip, UnzipTo)
 ' c:\users\amdeen\onedrive\here\documents\_work\rads\xmlreaddd\resources\7za.exe e -tgzip -aoa _
  \\remotefolder\group\RWT_QUEST\RWT\2015\PDS_Data\AAL11\2015_04_24_16_59\deu.xml.gz _
  -oc:\users\amdeen\onedrive\here\documents\_work\rads\xmlreaddd
 Cmd1 = Chr(34) & FixPath(FixPath() & "Resources") & "7za.exe" & Chr(34)
 Cmd2 = " e -tgzip -aoa "
 Cmd3 = Chr(34) & FullZip & Chr(34)
 Cmd4 = " -o" & Chr(34) & FixPath(UnzipTo) & "" & Chr(34)
 Set oShell = CreateObject("WSCript.shell")
 oShell.Run Cmd1 & Cmd2 & Cmd3 & Cmd4, 1, True
 DoEvents
 Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
End Sub

Parameters

FullZip, UnzipTo

Views 177 Downloads 62

Perm link