Macro to do something to every file in a folder- Excel

Macro to do something to every file in a folder- Excel

Sub Do_Something_To_All_Files_In_A_Folder()
Dim MyObj As Object, MySource As Object, file As Variant
Set MySource = MyObj.GetFolder(“Z:\Dropbox\Folder”)
For Each file In MySource.Files
If InStr(file.Name, “test”) > 0 Then
MsgBox “found”
Exit Sub
End If
Next file
End Sub