So why not prefix the code with 'On Error Resume Next'? Alternatively, you could trap that specific error. For example:
Code:
Sub ReplaceAvenue()
On Error GoTo Done
With Application.Dialogs(wdDialogEditReplace)
SendKeys "%m"
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Ave"
.Replacement.Text = "Avenue"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Show
End With
Done:
If Err.Number = 5452 Then Exit Sub
End Sub