Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.82 KB

Excel.Workbook.Protect.md

File metadata and controls

36 lines (23 loc) · 1.82 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.Protect method (Excel)
vbaxl10.chm199217
vbaxl10.chm199217
Excel.Workbook.Protect
0e270b93-7b0b-cc68-c7c0-4002024f4292
05/29/2019
medium

Workbook.Protect method (Excel)

Protects a workbook so that it cannot be modified.

Syntax

expression.Protect (Password, Structure, Windows)

expression A variable that represents a Workbook object.

Parameters

Name Required/Optional Data type Description
Password Optional Variant A string that specifies a case-sensitive password for the worksheet or workbook. If this argument is omitted, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook. If you forget the password, you cannot unprotect the worksheet or workbook.

Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27.

Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better.

It's critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.
Structure Optional Variant True to protect the structure of the workbook (the relative position of the sheets). The default value is False.
Windows Optional Variant True to protect the workbook windows. If this argument is omitted, the windows aren't protected.

[!includeSupport and feedback]