_Application.DisplayAlerts Property

True if Microsoft Excel displays certain alerts and messages while a macro is running.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property DisplayAlerts As Boolean
    Get
    Set
'Usage
Dim instance As _Application
Dim value As Boolean

value = instance.DisplayAlerts

instance.DisplayAlerts = value
bool DisplayAlerts { get; set; }

Property Value

Type: System.Boolean

Remarks

The default value is True. Set this property to False if you don’t want to be disturbed by prompts and alert messages while a program is running; any time a message requires a response, Microsoft Excel chooses the default response.

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

When using the SaveAs method for workbooks to overwrite an existing file, the 'Overwrite' alert has a default of 'No', while the 'Yes' response is selected by Excel when the DisplayAlerts property is set to False.

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Excel Namespace