Results 1 to 3 of 3

unzip

Threaded View

  1. #1
    Registered User
    Join Date
    03-01-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    34

    unzip

    i have some zip files say 6 in the folder d:\info

    i got a macro which is working file.

    this is prompting to select the folder where the zip files reside and doing unzipping

    But my requirement is , it should not prompt to select the folder. macro should unzip all the zip files mentioned in the macro

    Sub Unzip_Files()
    
    'Declare Variable
        Dim oApp As Object
        Dim Fname As Variant
        Dim Output_Folder As Variant
        Dim strDate As String
        Dim i As Long
       
        'Select multiple zip files to unzip
        Fname = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", _
                                            MultiSelect:=True)
        If IsArray(Fname) = False Then
            'Do nothing
        Else
            
            'Set output folder path for unzip files
            Output_Folder = "d:\abcd\"
            
            'Append backslash to output folder path
            If Right(Output_Folder, 1) <> "\" Then
                Output_Folder = Output_Folder & "\"
            End If
    
            'Extract the files into output folder
            Set oApp = CreateObject("Shell.Application")
            For i = LBound(Fname) To UBound(Fname)
                
                oApp.Namespace(Output_Folder).CopyHere oApp.Namespace(Fname(i)).items
    
            Next i
    
            MsgBox "You find the files here: " & "d:\abcd"
            
        End If
        
         Sheets("Sheet1").Select
        
    End Sub
    Last edited by np1966; 01-26-2017 at 01:35 AM. Reason: it is not as per forum rules

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unzip .gz file with VBA
    By chrisignm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2014, 07:14 PM
  2. [SOLVED] Error while trying to unzip
    By sabrefan1970 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2013, 11:03 AM
  3. [SOLVED] Unzip files to the another folder
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-12-2013, 08:33 AM
  4. Need macro to Zip/Unzip
    By Vinoth Kanna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 03:41 AM
  5. [SOLVED] Unzip file through VBA
    By amitdi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-15-2012, 09:36 PM
  6. unzip
    By aaabc0555 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2006, 04:45 PM
  7. Want to Unzip files automatically
    By Hari in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2005, 12:06 PM

Tags for this Thread

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