PEAR Manual
Prev |  | Next

# Worksheet::protect

Worksheet::protect -- Set the worksheet protection flag

## Synopsis

    require_once "Spreadsheet/Excel/Writer.php";

``void Worksheet::protect` (string $password)`

## Description

Set the worksheet protection flag to prevent accidental modification and to hide formulas if the locked and hidden format properties have been set.

## Parameter

- `string $password` - The password to use for protecting the sheet.

## Note

This function can not be called statically.

## Example

Example 37-1. Using protect()

Prev | Home | Next
Worksheet::setFirstSheet | Up | Worksheet::setColumn