Version

Worksheet Protection (Infragistics Excel Engine)

Topic Overview

Purpose

This topic explains how to set, remove and configure worksheet protection.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this section you will find information that will help you to better understand the object model and the functionalities of the Infragistics Excel Engine.

In order to get you up and running as quickly as possible with the Infragistics Excel Engine, this topic provides procedural instructions on how to create a workbook.

In this topic

This topic contains the following sections:

Worksheet Protection

Summary

The worksheet protection feature allows you to protect (with or without password) the following user operations:

  • Inserting, deleting and formatting of columns

  • Inserting, deleting and formatting of rows

  • Inserting of hyperlinks

  • Editing of objects (this setting allows or restricts editing of shapes, comments, charts or controls may be created or changed)

  • Editing of scenarios (this setting allows or restricts existing scenarios)

  • Filtering of data (this setting allows or restricts the use of auto filters)

  • Formatting of cells (this setting allows or restricts the user from changing cells' formatting)

  • Sorting of data

  • Pivot tables (this setting allows or restricts the user from changing pivot tables)

  • Cells editing (this setting allows or restricts the user from editing cells' value by providing cell ranges which can be edited when in protected mode)

  • Cells selection (this setting allows or restricts the user selection to all cells, unlocked cells only or no selection)

Note
Note

The protection is not enforced via the Infragistics Excel Engine’s object model. It is a responsibility of the UI visualizing this object model, to honor these protection settings and allow or restrict the user from performing the corresponding operations.

Configuration chart

The following table explains briefly the functional aspects of the worksheet protection feature and maps them to the properties and methods that operates with them.

Operation Details Properties

Set worksheet protection

You can use the overloads of the Protect method to protect the worksheet with password (supplied using string or SecureString) or without password. The other arguments of this method are used to specify each protection setting described above.

Remove worksheet protection

You can use the overloads of the Unprotect method to remove worksheet protection set with or without password.

If the password supplied to the Unprotect methods does not match the password set on the worksheet an exception will be thrown.

Note
Note

You can use the Unprotect overload method without password argument to remove protection even on password protected worksheets.

Check if a worksheet has protection

This read-only property returns true if the worksheet has any protection set using the overloads of the Protect method.

Check if a worksheet has password protection

This read-only property returns true if the worksheet has password protection.

Obtain worksheet protection

This read-only property returns an object of type WorksheetProtection which contains properties for obtaining each protection setting individually.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to operate with password encrypted files.

This topic explains how to set, remove and configure workbook protection.