Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 1.55 KB

Excel.ProtectedViewWindows.Open.md

File metadata and controls

57 lines (33 loc) · 1.55 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ProtectedViewWindows.Open method (Excel)
vbaxl10.chm913077
vbaxl10.chm913077
Excel.ProtectedViewWindows.Open
bb003d53-949e-842a-f6f1-3ca30f396837
05/09/2019
medium

ProtectedViewWindows.Open method (Excel)

Opens the specified workbook in a new Protected View window.

Syntax

expression.Open (FileName, Password, AddToMru, RepairMode)

expression A variable that represents a ProtectedViewWindows object.

Parameters

Name Required/Optional Data type Description
FileName Required String The name of the workbook (paths are accepted).
Password Optional Variant The password for opening the workbook.
AddToMru Optional Variant True to add the file name to the list of recently used files on the Recent tab of the Backstage view.
RepairMode Optional Variant True to repair the workbook to prevent file corruption.

Return value

ProtectedViewWindow

Remarks

Avoid using hard-coded passwords in your applications. If a password is required in a procedure, request the password from the user, store it in a variable, and then use the variable in your code.

Example

The following code example opens a workbook in a new Protected View window.

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

[!includeSupport and feedback]