Sub Hello()
Dim Bk As Workbook
Dim Sht As Worksheet
With Application.FileSearch
.NewSearch
.LookIn = "C:\temp"
.SearchSubFolders = False
.Filename = "*.xls"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
With Application.FileSearch
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set Bk = Application.Workbooks.Open(.FoundFiles(i))
For Each Sht In Bk.Worksheets
Sht.Range("A1").Value = "hello"
Next Sht
Bk.Save
Bk.Close
Next i
Else
MsgBox "There were no files found.", vbCritical, "Error 101"
End If
End With
End Sub