Skip to content

Latest commit

 

History

History
53 lines (30 loc) · 1.49 KB

Excel.ProtectedViewWindow.Workbook.md

File metadata and controls

53 lines (30 loc) · 1.49 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ProtectedViewWindow.Workbook property (Excel)
vbaxl10.chm914084
vbaxl10.chm914084
Excel.ProtectedViewWindow.Workbook
379b98f0-b177-7910-4968-ce4ed2f1ca9d
05/09/2019
medium

ProtectedViewWindow.Workbook property (Excel)

Returns an object that represents the workbook that is open in the specified Protected View window. Read-only.

Syntax

expression.Workbook

expression A variable that represents a ProtectedViewWindow object.

Return value

Workbook

Remarks

Because a Protected View window is designed to protect the user from potentially malicious code, the operations that you can perform by using a Workbook object returned by the Workbook method will be limited. Any operation that is not allowed will return an error.

A workbook displayed in a Protected View window is not a member of the Workbooks collection. Instead, use the Workbook property to access a workbook that is displayed in a Protected View window.

Example

The following example uses the Workbook property to return the workbook that is open in the first Protected View window.

Dim wbProtected As Workbook 
 
If Application.ProtectedViewWindows.Count > 0 Then 
    Set wbProtected = Application.ProtectedViewWindows(1).Workbook 
End If 

[!includeSupport and feedback]