[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Launching WinZip from the Shell

Posted on 2003-11-25
2
Medium Priority
?
437 Views
Last Modified: 2008-03-06
Hi experts,
           i've been trying to start winzip from the shell, but each time, I have the file not found error  ... !!??

But if I paste the content of strCommande in the "run" box of Windows, it goes ok.  What am I doing wrong here ?

Here is my code:

*********************
these are the parameter sent to the function :

GestionWinZip.GestionWinZip m_strEnvironnement, "c:\test.zip", Fichier.Path

m_strEnvironnement = "CAPDEV"
Fichier.Path = "D:\Donnees_devl\CAP2002\Capfax\ReceptionRsp\Capdev\1004363.rsp"

Public Sub GestionWinZip(ByVal strEnvironnement As String, ByVal strNomArchive As String, ByVal strFichiers As String)
   
    Dim strWinZipPath As String
    Dim strCommande As String
   
    Dim fso As New Scripting.FileSystemObject
   
    On Error GoTo TrappeErreur
   
    'Si le nom du fichier à compresser possède des espaces, l'entouré de ""
    If InStr(1, strFichiers, " ", vbTextCompare) <> 0 Then
        strFichiers = Chr(34) & strFichiers & Chr(34)
    End If
           
    If (Not fso.FileExists(strNomArchive)) Then
        fso.CreateTextFile (strNomArchive)
    End If
   
    strCommande = "WINZIP32.EXE -min -a " & strNomArchive & " " & "'" + strFichiers + "'"
   
    Shell(strCommande, vbHide)
   
    'Shell("winzip32 -min -a c:\test.zip c:\op.txt", vbHide)
   
    Set fso = Nothing
   
TrappeErreur:
   
    Set fso = Nothing
   
    Err.Raise vbObjectError + 100, "Projet1.GestionWinzip", "Problème avec la compression WinZip."

End Sub

***************************************

The same thing happens when I do a test with :

 Shell("winzip32 -min -a c:\test.zip c:\op.txt", vbHide)

THanks a lot, and a lot of beer to ya all !

Regards!
0
Comment
Question by:David MacDonald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Informative earned 300 total points
ID: 9820347
This works fine for me.

Dim x As Variant
x = Shell("winzip32.exe -min -a c:\test.zip c:\op.txt", vbHide)

All I had to do to make it work properly was either give the full qualified path of winzip or else copy everything from the winzip folder into say Windows\system32 where it will be certainly found in the path.  I'm using Winzip 8.1

Cheers and have a Slurpee on me.
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 9820369
hahah ... funny me ... the idea of the coming beer must've clouded my mind with hapinness ... itwork well with the full qualified path ...

Thanks a lot Informative ...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question