Microsoft Office Tutorials and References
In Depth Information
Chart protection properties
Are Protected Sheets Secure?
Contrary to popular belief, protecting a worksheet with a password is not a security
feature — it’s a convenience feature. Sheet protection is intended primarily to prevent
accidental erasure of cells. In a typical scenario, formula cells are locked and data
input cells are not locked. Then, when the sheet is protected, the formula cells cannot
be deleted or overwritten by values. It is a fairly simple matter to “crack” the password
for a protected sheet.
Chart protection properties
Excel offers some other types of chart protection that most people don’t know about.
Specifically, a Chart object has the following protection-related properties (all
these have a value of False, by default):
ProtectData: If True, the SERIES formula cannot be modified.
ProtectFormatting: If True, the chart’s formatting cannot be modified.
ProtectSelection: If True, chart elements cannot be selected.
ProtectGoalSeek: If True, the user cannot modify the chart’s data by
dragging a data point.
It’s important to understand that these properties are not persistent. In
other words, they are not saved with the workbook. For example, if you
execute a macro that sets a chart’s ProtectData property to True, that
property will be False when the workbook is closed and re-opened. You’ll need to
rerun the macro to set the property to True.
Protecting all charts when the workbook is opened
Excel provides a way to execute a macro automatically when the workbook is
opened. This is done by using a procedure named Workbook_Open , which must be
located in the code module for the ThisWorkbook object.
The following procedure is executed when the workbook opens. It loops
though all worksheets and through all charts on each worksheet. It sets the
ProtectFormatting property to True. In other words, after this procedure executes,
no embedded charts can be formatted.
Search JabSto ::

Custom Search