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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing code with command line

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
I need to zip a file. Unfortunately Winzip only supports this through the new add-in wzzip using the command line prompts.

the following code works in MS-DOS that will zip the Excel file "MyFile.xls"

"C:\Program Files\Winzip\wzzip" MyZipFile.zip C:\MyFile.xls

I've tried this code in Access:

Shell(chr(34) & "C:\Program Files\Winzip\wzzip" & chr(34) & "MyZipFile.zip C:\MyFile.xls",1)

It starts the msdos window but does not zip any files. Can anyone help me.

Thanks,
Bill N

 
Your example is first. You shouldn't need to use the chr(34) function and you don't have a space after wzzip.

Shell(chr(34) & "C:\Program Files\Winzip\wzzip" & chr(34) & "MyZipFile.zip C:\MyFile.xls",1)


Try this:
Shell("'C:\Program Files\Winzip\wzzip' MyZipFile.zip C:\MyFile.xls",1)

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top