So again it works the first time but crashes.
It seems that after it finds all the files and extracts from them it starts to attempt to do it to the zmaster file, which obviously causes problems.
Upon Re-opening I added a line I don't know is valid but worth a try
Do While Len(sFile)
Debug.Print Now, sFile
If LCase(sFile) <> LCase(ThisWorkbook.Name) Then
Workbooks.Open (sFile)
Range("A2:D3").Copy Sheet1.Cells(Rows.Count, "A").End(xlUp)(2)
ActiveWorkbook.Close SaveChanges:=False
sFile = Dir
End If
Loop
Application.Stop (Now + TimeValue("0:00:05"))
End Sub
I went through the code one line at a time and it went down fine until I reached workbooks.open and then it gave the classic suppliers-a.xlsx cannot be found.
Bookmarks