HotXLS Delphi Excel Read Write Library / Component Developers Guide loslab Inc.

Protect method

Protects a Worksheet so that it cannot be modified.

Syntax

procedure Protect();
procedure Protect(Password: string);
Password String. A string that specifies a case-sensitive password for the Worksheet. If this argument is omitted, you can unprotect the Worksheet without using a password. Otherwise, you must specify the password to unprotect the Worksheet.

Example

This example protects Worksheet one.

Workbook.Sheets[1].Protect('mypass123');
Copyright©2007-2019 loslab.com