Table of Content

There are many vbscripts to generate zip file from one folder, however for me this is fast and easy way to create zip or 7z file.

function zip

Private Sub zip(zipFile, sFolder)
toolpath = ThisWorkbook.path
ziptool = toolpath & "/../7-Zip/7z.exe"

ShellStr = ziptool & " a -tzip " & zipFile & " -r " & sFolder & "\"
RetVal = Shell(ShellStr)

End Sub

test script

Here is test script.


Private Sub ziptest()
zip "c:\test.zip","c:\test"
End Sub