Nevermind. Found it:
doc.Application.DisplayAlerts = False turns them off.
: Did you ever find a solution to this problem?
:
: I'm facing the exact same problem. This is code that ran fine in older versions of Excel, but now crashes because of the message box in Excel 2003.
:
: Thanks,
:
:
: : The following subroutine finds and replace occurances of a string in an xls file; the code works find in its task, however, when it finds no results it prompts the user. I don't want it to do that- any ideas?
: : Thanks.
: :
: : Sub excelReplace(filename As String, searchString As String, replacement As String)
: :
: : On Error GoTo ErrorHandler
: :
: : Dim doc As Excel.Application
: : Set doc = CreateObject("Excel.Application")
: : doc.Workbooks.Open (filename)
: : 'Dim found As Boolean
: : Dim currentSheet As Worksheet
: :
: : For Each currentSheet In doc.Worksheets
: : currentSheet.Cells.Replace(What:=searchString, replacement:=replacement, LookAt:=xlPart, SearchOrder _
: : :=xlByRows, MatchCase:=chkMatchCase.Value, SearchFormat:=False, ReplaceFormat:=False)
: : Next
: :
: : Dim currentWorkbook As workbook
: :
: : For Each currentWorkbook In doc.Workbooks
: : currentWorkbook.Save
: : Next currentWorkbook
: :
: : Call doc.Workbooks.Close
: : Set doc = Nothing
: : Exit Sub
: :
: : ErrorHandler:
: :
: : Call MsgBox("An Error Occured:" & Chr(13) & Chr(13) & "Error Number : " & Err.Number & Chr(13) & Chr(13) & Err.Description, vbOKOnly + vbCritical, "Error")
: : Err.Clear
: :
: : End Sub
: :
:
: