ProtectedViewWindow Interface

Definition

Represents a Protected View window.

public interface class ProtectedViewWindow
[System.Runtime.InteropServices.Guid("000244CD-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface ProtectedViewWindow
Public Interface ProtectedViewWindow
Attributes

Remarks

A Protected View window is used to display a workbook from a potentially unsafe location. Unsafe locations are defined as the following:

  1. Files opened from the Internet.
  2. Attachments opened from Microsoft Outlook 2010.
  3. Files blocked by File Block Policy.
  4. Files that fail Office File Validation.
  5. Files explicitly opened in Protected View by using the Open in Protected View command of the Open button in the Open dialog box.

Workbooks displayed in a Protected View window cannot be edited and are restricted from running active content such as Visual Basic for Applications macros and data connections.

To return a single ProtectedViewWindow object from the ProtectedViewWindows collection, use ProtectedViewWindows(Index), where Index is the index number of the window you want to open. You can also access the ProtectedViewWindow object that represents the active Protected View window by using the Microsoft.Office.Interop.Excel.Application.ActiveProtectedViewWindow property of the Application object.

After you access a ProtectedViewWindow object, use the Workbook property to access the Workbook object that represents the workbook file that is open in the Protected View window. Because a Protected View window is designed to protect the user from potentially malicious code, the operations you can perform by using a Workbook object returned by a ProtectedViewWindow object will be limited. Most operations that are not allowed will return "Run-time error 1004: This command is not available when Excel is sandboxed."

Properties

_Default
Caption

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

EnableResize

Gets or sets whether the Protected View window can be resized.

Height

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

Left

Gets 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

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

SourcePath

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

Top

Gets 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

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

Width

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

WindowState

Gets or sets the state of the specified Protected View window.

Workbook

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

Methods

Activate()

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

Close()

Closes the specified Protected View window.

Edit(Object, Object)

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

Applies to