Hi All,
I have 2 zip folders in current directory. I want to copy all csv files within the zip folder to current directory (same directory with zip folders). I try the following code but it only copy zip folder and not csv files within the zip folder. Kindly assist. Thanks.
I have 2 zip folders in current directory. I want to copy all csv files within the zip folder to current directory (same directory with zip folders). I try the following code but it only copy zip folder and not csv files within the zip folder. Kindly assist. Thanks.
VBA Code:
Sub Unzipfiles()
Dim sh As New Shell32.Shell
Path = "C:\Users\My\Downloads\"
Filename = Dir(Path & "*.zip")
' Disable Screen Updating is used to stop screen flickering and Disable Events is used to avoid interrupted dialog boxes / popups
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Do While Filename <> ""
Filename = Dir()
Loop
'Destination & Source Path
sh.Namespace(Path).CopyHere _
sh.Namespace(Path & Filename).Items, 16
End Sub