Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Protect Method

_Chart.Protect Method

Protects a chart so that it cannot be modified.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

void Protect(
	Object Password,
	Object DrawingObjects,
	Object Contents,
	Object Scenarios,
	Object UserInterfaceOnly
)

Parameters

Password
Type: System.Object

Optional Object. 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. It's a good idea to keep a list of your passwords and their corresponding document names in a safe place.

DrawingObjects
Type: System.Object

Optional Object. True to protect shapes. The default value is False.

Contents
Type: System.Object

Optional Object. True to protect contents. For a chart, this protects the entire chart. For a worksheet, this protects the locked cells. The default value is True.

Scenarios
Type: System.Object

Optional Object. True to protect scenarios. This argument is valid only for worksheets. The default value is True.

UserInterfaceOnly
Type: System.Object

Optional Object. True to protect the user interface, but not macros. If this argument is omitted, protection applies both to macros and to the user interface.

Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

Show:
© 2015 Microsoft