DisplayAlerts Property Example

This example closes the workbook Book1.xls and doesn’t prompt the user to save changes. Any changes to Book1.xls aren’t saved.

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

This example suppresses the message that otherwise appears when you initiate a DDE channel to an application that’s not running.

Application.DisplayAlerts = False
channelNumber = Application.DDEInitiate( _
    app:="WinWord", _
    topic:="C:\WINWORD\FORMLETR.DOC")
Application.DisplayAlerts = True
Application.DDEExecute channelNumber, "[FILEPRINT]"
Application.DDETerminate channelNumber
Application.DisplayAlerts = True