Chart.Protect Method
Excel Developer Reference |
Protects a chart so that it cannot be modified.
Syntax
expression.Protect(Password, DrawingObjects, Contents, Scenarios, UserInterfaceOnly)
expression A variable that represents a Chart 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. |
DrawingObjects | Optional | Variant | True to protect shapes. The default value is True. |
Contents | Optional | Variant | 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 | Optional | Variant | True to protect scenarios. This argument is valid only for worksheets. The default value is True. |
UserInterfaceOnly | Optional | Variant | True to protect the user interface, but not macros. If this argument is omitted, protection applies both to macros and to the user interface. |
See Also