CreateZipFolder_7Zip

Creates a zip from folder using 7Z archive.
7za,exe (found in attached zip) file expected to be in a folder called "Resources" next to that workbook
All files in folder will be added to archive, please consider timing when adding large folders

Sub CreateZipFolder_7Zip(FullFolder, ZipFile)
 ' Creates a Zip file from a folder
 Cmd1 = Chr(34) & FixPath(FixPath() & "Resources") & "7za.exe" & Chr(34)
 Cmd2 = " a -tzip "
 Cmd3 = Chr(34) & ZipFile & Chr(34)
 Cmd4 = " " & Chr(34) & FixPath(FullFolder) & "*.*" & Chr(34)
 Shell Cmd1 & Cmd2 & Cmd3 & Cmd4, vbHide
 DoEvents
 Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
 DoEvents
End Sub

FullFolder, ZipFile

Views 2000 Downloads 936


ANmarAmdeen
590
Attachments
File System VBA-Excel
Revisions

v1.0