Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell command to Zip & Unzip files

Status
Not open for further replies.

Henaniy

Programmer
May 2, 2002
12
0
0
US
Does anyone know what the vba shell command is to unzip a file?

Any other alternatives would also be appreciated.
 
Hi

Hope it is of use coding to do both zip and unzip

Function ZIP()
'TO ZIP A FILE

Dim FileToSave As String, ZipFileName As String



FileToSave = "C:\YOUR_FILE_TO_ZIP.TXT"

ZipFileName = "C:\YOUR_ZIP_FILE"

Call Shell("c:\Program Files\winzip\Winzip32.exe -A " _
& ZipFileName & " " & FileToSave, 1)





End Function


Then to Unzip

Function unZIP()
'TO UNZIP A FILE

Dim FileToUnzip As String, ZipOutputTo As String



FileToUnzip = "C:\YOUR_ZIP_FILE.ZIP"

ZipOutputTo = "C:\"

Call Shell("c:\Program Files\winzip\Winzip32.exe -e " _
& FileToUnzip & " " & ZipOutputTo, 1)





End Function

regards

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top