+ Reply to Thread
Results 1 to 2 of 2

Want to Unzip files automatically

  1. #1
    Hari
    Guest

    Want to Unzip files automatically

    Hi,

    I want to open some Zipped files through VBA (Excel) and then unzip them to
    my target folder.
    I got ready made stuff for me from Ron de Bruin's site
    http://www.rondebruin.nl/unzip.htm#zip

    But the problem is ....I have Windows XP and probably zipping is integrated
    in to XP so for me
    the statement "Pathwinzip = .." doesnt make sense. Also, within ShellStr it
    did not make sense to me
    to include pathname so, I modified the above code to the following...

    Sub UnZip_ZipFile_1change()
    Dim PathWinZip As String, FileNameZip As String
    Dim ShellStr As String, FolderName As String

    FileNameZip = "C:\Documents and Settings\abc\Desktop\DEV1_1022.zip"
    FolderName = "C:\Documents and Settings\abc\Desktop\Unzipped data"

    ShellStr = FileNameZip & Chr(34) _
    & " " & Chr(34) & FolderName & Chr(34)
    ShellAndWait ShellStr, vbHide
    MsgBox "Look in " & FolderName & " for extracted files"
    End Sub

    But by doing that, VBA displays an error "Run-time error '53': File not
    found" when it is processing "hProg = shell(PathName, WindowState)" within
    Public Sub ShellAndWait .

    (I didnt want to make the mail very big, so didnt paste Ron's actual code
    here. If that is not a correct practice please tell me so and in future I
    would paste the 'source-code' as well)

    --
    Thanks a lot,
    Hari
    India



  2. #2
    Ron de Bruin
    Guest

    Re: Want to Unzip files automatically

    Hi Hari

    http://www.rondebruin.nl/zip.htm
    http://www.rondebruin.nl/unzip.htm#zip

    From my site

    >The examples are only working If you use WinZip as your Zip program.
    >(Note: you must have a registered copy of WinZip)


    As far as i know you can't run the Windows Xp zip program with code

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Hari" <[email protected]> wrote in message news:eGRtcTi%[email protected]...
    > Hi,
    >
    > I want to open some Zipped files through VBA (Excel) and then unzip them to
    > my target folder.
    > I got ready made stuff for me from Ron de Bruin's site
    > http://www.rondebruin.nl/unzip.htm#zip
    >
    > But the problem is ....I have Windows XP and probably zipping is integrated
    > in to XP so for me
    > the statement "Pathwinzip = .." doesnt make sense. Also, within ShellStr it
    > did not make sense to me
    > to include pathname so, I modified the above code to the following...
    >
    > Sub UnZip_ZipFile_1change()
    > Dim PathWinZip As String, FileNameZip As String
    > Dim ShellStr As String, FolderName As String
    >
    > FileNameZip = "C:\Documents and Settings\abc\Desktop\DEV1_1022.zip"
    > FolderName = "C:\Documents and Settings\abc\Desktop\Unzipped data"
    >
    > ShellStr = FileNameZip & Chr(34) _
    > & " " & Chr(34) & FolderName & Chr(34)
    > ShellAndWait ShellStr, vbHide
    > MsgBox "Look in " & FolderName & " for extracted files"
    > End Sub
    >
    > But by doing that, VBA displays an error "Run-time error '53': File not
    > found" when it is processing "hProg = shell(PathName, WindowState)" within
    > Public Sub ShellAndWait .
    >
    > (I didnt want to make the mail very big, so didnt paste Ron's actual code
    > here. If that is not a correct practice please tell me so and in future I
    > would paste the 'source-code' as well)
    >
    > --
    > Thanks a lot,
    > Hari
    > India
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1