Skip to main content

Application.DisplayAlerts property

Table of contents
  1. Syntax
  2. Remarks
  3. Examples

True if Microsoft Excel displays certain alerts and messages while a macro is running. Read/write Boolean.



expression A variable that represents an Application object.


The default value is True. Set this property to False to suppress prompts and alert messages while a macro is running; when a message requires a response, Microsoft Excel chooses the default response.

If you set this property to False, Excel sets this property to True when the code is finished, unless you are running cross-process code.


This example closes the Workbook Book1.xls and does not prompt the user to save changes. Changes to Book1.xls are not saved.

Application.DisplayAlerts = False 
Application.DisplayAlerts = True

This example suppresses the message that otherwise appears when you initiate a DDE channel to an application that is 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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>