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
Bookmarks