well my problem is that I have this code, so when I run it star to work and after a few minutes crash sometimes excel just close and sometimes restar the program.
this code is made for open a file inside of a list when the file is open, search inside of the file and find textbox with certain word and replace with another word, the problem is that just a few minutes after star to work excel restar or close and I don't know why. this is the code:
sub search
Dim ws As Worksheet
Dim tBox As Object
Dim stBox As String
Application.ScreenUpdating = False
Sheet1.Activate
For i = 1 To 4298
ExcelPath = Cells(i, 1).Value
Workbooks.Open Filename:=ExcelPath
ActiveWindow.Visible = False
Set ws = ActiveSheet
For Each tBox In ws.Shapes
On Error Resume Next
stBox = " "
newv = " "
tBox.TextFrame.Characters.Text = Replace(stBox, newv, newv)
On Error GoTo 0
Next
ActiveWorkbook.CheckCompatibility = False
ActiveWorkbook.Close True
A = (i / 4298) * 100
Application.StatusBar = Mid(A, 1, 4)
Next i
end sub