THank you Verymuch for that Dave. Couldn't get to an internet connection to check anything. I've been tinkering with the code and I almost have the final result except for the part where I need to select the files when the Open files dialog comes up.
Sub Unzip4()
Dim fso As Object
Dim oApp As Object
Dim Fname As Variant
Dim FileNameFolder As Variant
Dim DefPath, Filespec As String
Dim strDate As String
Dim fnm As String
Dim I As Long
Dim num As Long
Dim Zipfilename As String
Dim DFTFile As Variant
Fname = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", _
MultiSelect:=True)
If IsArray(Fname) = False Then
' Do nothing
Else
' create default folder
DefPath = "C:\Documents and Settings\abc\Desktop\UpZipfiles\"
Filespec = "C:\Documents and Settings\abc\Desktop\UpZipfiles\*"
' Delete all folders in defpath
DeleteAFolder (Filespec)
For I = LBound(Fname) To UBound(Fname)
' Gets the Folder Name for the new Folder
fnm = Filename(Fname(I))
FileNameFolder = DefPath & fnm
' Make the normal folder in DefPath
MkDir FileNameFolder
' Gets the fiename(DFT File) that need to be extracted depending on the folder
DFTFile = DFTfilename(fnm)
' Extract the files into the newly created folder
Set oApp = CreateObject("Shell.Application")
For Each oAppfile In oApp.Namespace(Fname(I)).items
Zipfilename = Mainfilename(oAppfile)
If Zipfilename Like DFTFile Then
oApp.Namespace(FileNameFolder).CopyHere (oAppfile)
End If
Next
Next I
On Error Resume Next
Set fso = CreateObject("scripting.filesystemobject")
fso.DeleteFolder Environ("Temp") & "\Temporary Directory*", True
End If
End Sub
It's this bit where i have prob with
Fname = Application.GetOpenFilename(filefilter:="Zip Files (*.zip), *.zip", MultiSelect:=True)
Is there any way to direct the VB code to access all the zip files in the folder?