I have wrote following code
Private Sub ZipFile_FX(ZipFileName As String, fileToBeZipped As String)
Const ZIPEXELOCATION = "c:\program files\winzip\winzip32.exe"
Shell ZIPEXELOCATION & " -a " & Chr(34) & ZipFileName & Chr(34) & _
" " & Chr(34) & fileToBeZipped & Chr(34), vbNormalFocus
End Sub
sub zips()
Call ZipFile_FX("c:\a.zip", "c:\a.xls")
end sub
Problem with with code is that when I run the program then winzip program is open asked me to run, then I have to click on agree. I don't want winzip ask me to run. Second I add password and add more files in this.