I have this formula and Im getting Error 1004, saying that file was possible removed or renamed or deleted, but in reality file is just there.
Im getting the error on this line : Workbooks.Open (MyFile)
Sub LoopThroughDirectory()
Dim MyFile As String
Dim erow MyFile = Dir("C:\Users\congresojr.5\Desktop\Puller Sample\sample file\")
Do While Len(MyFile) > 0
If MyFile = "zzzPuller.xlsm" Then
Exit Sub
End If
Workbooks.Open (MyFile) Range("B11:J31").Copy ActiveWorkbook.Close
erow = RawPuller.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste
Destination:=Worksheets("RawPuller").Range(Cells(erow, 2),
Cells(erow, 10))
MyFile = Dir
Loop
End Sub