Class ProtectedViewWindow (Excel VBA)

The class ProtectedViewWindow represents a Protected View window.

The main procedures of class ProtectedViewWindow are Activate, Close and ProtectedViewWindows.Open

Set

To use a ProtectedViewWindow class variable it first needs to be instantiated, for example

Dim pvw as ProtectedViewWindow
Set pvw = Application.ActiveProtectedViewWindow

The following procedures can be used to set variables of type ProtectedViewWindow: Application.ActiveProtectedViewWindow, ProtectedViewWindows.Item, ProtectedViewWindows.Open and Application.ProtectedViewWindows

For Each

Here is an example of processing the ProtectedViewWindow items in a collection.

Dim pvw As ProtectedViewWindow
For Each pvw In Application.ProtectedViewWindows
	
Next pvw

Methods

These are the main methods of the ProtectedViewWindow class

Activate - Brings the Protected View window to the front of the z-order.

Application.ActiveProtectedViewWindow.Activate

Close - Closes the specified Protected View window.

Dim booClose As Boolean
booClose = Application.ActiveProtectedViewWindow.Close()

ProtectedViewWindows.Open - Opens the specified workbook in a new Protected View window.

ProtectedViewWindows.Open FileName:="C:\MyFiles\MyWorkbook.xls" 

Other Methods

Edit - Opens the workbook that is open for editing in the specified Protected View window.

Properties

Caption returns or sets a value that represents the name that appears in the title bar of the Protected View window.

EnableResize true if the Protected View window can be resized.

Height returns or sets a value that represents the height, in points, of the Protected View window.

Left returns or sets a value that represents the distance, in points, from the left edge of the client area to the left edge of the Protected View window.

SourceName returns the name of the source file that is open in the specified Protected View window.

SourcePath returns the path of the source file that is open in the specified Protected View window.

Top returns or sets a value that represents the distance, in points, from the top edge of the specified Protected View window to the top edge of the usable area.

Visible returns or sets a value that determines whether the specified Protected View window is visible.

Width returns or sets a value that specifies the width, in points, of the specified Protected View window.

WindowState returns or sets the state of the specified Protected View window.

Workbook returns an object that represents the workbook that is open in the specified Protected View window.

ProtectedViewWindows.Count returns a Long value that represents the number of objects in the collection.

ProtectedViewWindows.Item returns a single object from a collection.

ProtectedViewWindows.Parent returns the parent object for the specified object. Read-only.