Application.ProtectedViewWindowDeactivate event (Excel)

Occurs when a Protected View window is deactivated.


expression.ProtectedViewWindowDeactivate (Pvw)

expression A variable that represents an Application object.


Name Required/Optional Data type Description
Pvw Required ProtectedViewWindow An object that represents the deactivated Protected View window.

Return value



The following code example minimizes any Protected View window when it is deactivated. This code must be placed in a class module, and an instance of that class must be correctly initialized.

For more information about how to use event procedures with the Application object, see Using events with the Application object.

Private Sub App_ProtectedViewWindowDeactivate(ByVal Pvw As ProtectedViewWindow) 
 Pvw.WindowState = xlProtectedViewWindowMinimized 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.