Skip to main content

Application.ProtectedViewWindowOpen event

Occurs when a workbook is opened in a Protected View window.


expression.ProtectedViewWindowOpen (Pvw)

expression A variable that represents an Application object.


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

Return value



The following code example informs the user that the workbook will be opened in a Protected View window. 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_ProtectedViewWindowOpen(ByVal Pvw As ProtectedViewWindow)
    MsgBox "You are opening the following workbook in Protected View: " & Pvw.Caption
End Sub

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>