Hi all
Try this optimised code
Sub test()
Dim sDir As String, sFname As String
Dim thswbk As Workbook, actvbk As Workbook
Set thswbk = ThisWorkbook
Application.ScreenUpdating = False
sDir = "C:\Mycomputer\Testing"
sFname = Dir(sDir & "\Final Test*.xls") ' I want to open any file contains Left 10 Chars = "Final Test"
Application.DisplayAlerts = False
Do While sFname <> ""
Set actvbk = Workbooks.Open(sDir & "\" & sFname, Format:=1, Local:=True)
Call Macro1
actvbk.Close
' Delete file
kill sDir & "\" & sFname
sFname = Dir
Loop
thswbk.Activate
Application.ScreenUpdating = True
End Sub
Bookmarks