Version

Workbook Protection (Infragistics Excel Engine)

Topic Overview

Purpose

This topic explains how to set, remove and configure workbook 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:

Workbook Protection

Summary

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

  • Window protection: the ability to resize the MDI child window of the workbook for legacy versions of MS Excel which were displaying each workbook in a separate child window.

  • Workbook structure: the ability to add, rename, delete, hide and reorder the worksheets.

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 workbook protection feature and maps them to the properties and methods that operate with them.

Operation Details Property/Method

Set workbook protection

You can use the overloads of the Protect method to protect the workbook 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 workbook protection

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

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

Note
Note

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

Check if a workbook has protection

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

Check if a workbook has password protection

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

Obtain workbook protection

This read-only property returns an object of type WorkbookProtection 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 worksheet protection.