Sub ReplaceStringInExcelFiles()
Dim MyFile As String
Dim FilePath As String
Dim orig As String
Dim news As String
Dim wb As Workbook, ws As Worksheet
orig = "dog"
news = "cow"
FilePath = "F:\DESTOP00\1\"
MyFile = Dir(FilePath & "*.xls*")
Do While Len(MyFile) > 0
Set wb = Workbooks.Open(FilePath & MyFile) '<< assign the workbook to wb
'Loop over the worksheets
'Note: no need to activate/select
For Each ws In wb.Worksheets
ws.UsedRange.Cells.Replace what:=orig, _
Replacement:=news, _
lookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
'xu ly cho textbox
On Error Resume Next
For Each shp In ws.Shapes
xValue = shp.TextFrame.Characters.Text
shp.TextFrame.Characters.Text = VBA.Replace(xValue, orig, news, 1)
Next
Next ws
ActiveWorkbook.Close savechanges:=True
MyFile = Dir
Loop
End Sub