EnableAutoRecover Property

Microsoft Excel Visual Basic

expression.EnableAutoRecover

expression    Required. An expression that returns a Workbook object.

Example

The following example checks the setting of the AutoRecover feature and if not enabled, Excel enables it and then notifies the user.

Sub UseAutoRecover()

    ' Check to see if the feature is enabled, if not, enable it.
    If ActiveWorkbook.EnableAutoRecover = False Then
        ActiveWorkbook.EnableAutoRecover = True
        MsgBox "The AutoRecover feature has been enabled."
    Else
        MsgBox "The AutoRecover feature is already enabled."
    End If

End Sub