MS Excel: Zip a file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ammoos
    New Member
    • Apr 2007
    • 100

    MS Excel: Zip a file

    Hi Friends

    I am developing an excel application for e mail the copy of active worksheet. I successfully developed that functionality but my issue is sometimes this mail goes to spam folder since that work book have some macros.. so I decided to zip the copy of workbook before sending.. To zip the file I need to know the path where WinZip is installed.. How can I get the path where this winzip is installed... Can anyone help me?

    Thanks

    Ammoos
  • Denburt
    Recognized Expert Top Contributor
    • Mar 2007
    • 1356

    #2
    Although I doubt zipping it will work you might want to verify it by sending one manually before spending time heading down the wrong road. If that ODES work then take a look at this article and let me know if it helps.

    Comment

    • Denburt
      Recognized Expert Top Contributor
      • Mar 2007
      • 1356

      #3
      I had this problem in the past and zipping didn't work for me and sometimes simply renaming the last three letters or removing them will work but thats depends on the systems and how they are set up to handle such things.

      Comment

      • ammoos
        New Member
        • Apr 2007
        • 100

        #4
        Many thanks Denburt .......

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by ammoos
          Hi Friends

          I am developing an excel application for e mail the copy of active worksheet. I successfully developed that functionality but my issue is sometimes this mail goes to spam folder since that work book have some macros.. so I decided to zip the copy of workbook before sending.. To zip the file I need to know the path where WinZip is installed.. How can I get the path where this winzip is installed... Can anyone help me?

          Thanks

          Ammoos
          You definately cannot assume that WinZip was installed using the Default Path, and you probably do not want to search the entire Hard Drive for the Path. A shot-in-the-dark would be to search all your Environmental Variables to see if there would be some indication as to where WinZip would be installed. To see all the values of your Environmental Variables:
          Code:
          Dim intCounter As Integer
          
          For intCounter = 1 To 100
            If Environ(intCounter) <> "" Then
              Debug.Print Environ(intCounter)
            Else
              Exit Sub
            End If
          Next
          On a Test PC, typical Output would be (WinZip not installed):
          Code:
          ALLUSERSPROFILE=C:\Documents and Settings\All Users
          APPDATA=C:\Documents and Settings\Security\Application Data
          CommonProgramFiles=C:\Program Files\Common Files
          COMPUTERNAME=SECURITY-3
          ComSpec=C:\WINDOWS\system32\cmd.exe
          FP_NO_HOST_CHECK=NO
          HOMEDRIVE=H:
          HOMEPATH=\
          HOMESHARE=\\rpacfso2\security$
          LOGONSERVER=\\RPACFSO2
          NUMBER_OF_PROCESSORS=1
          OS=Windows_NT
          Path=C:\Program Files\Microsoft Office\OFFICE11\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Crystal Decisions\2.0\bin
          PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
          PROCESSOR_ARCHITECTURE=x86
          PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel
          PROCESSOR_LEVEL=15
          PROCESSOR_REVISION=0209
          ProgramFiles=C:\Program Files
          SESSIONNAME=Console
          SystemDrive=C:
          SystemRoot=C:\WINDOWS
          TEMP=C:\DOCUME~1\Security\LOCALS~1\Temp
          TMP=C:\DOCUME~1\Security\LOCALS~1\Temp
          USERDNSDOMAIN=RPAC.ORG
          USERDOMAIN=RPAC
          USERNAME=security
          USERPROFILE=C:\Documents and Settings\Security
          WecVersionForRosebud.8A4=2
          windir=C:\WINDOWS

          Comment

          Working...