Version

Password Support (Infragistics Excel Engine)

Topic Overview

Purpose

This topic explains how to operate with password encrypted files.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

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

This topic explains how to read an existing Excel file.

Introduction

Password support summary

The Infragistics Excel Engine’s password support provides you the following abilities for working with encrypted/protected workbooks:

  • inspecting whether a workbook is encrypted with an open password

  • inspecting whether an opened workbook is write protected

  • loading and saving password encrypted workbooks

  • validating write protected workbooks

  • setting or clearing the open password of an encrypted workbook

  • setting or clearing the password for a write protected workbook

Operate with Open Password Encrypted Workbook

Overview

The following table lists the properties and methods associated with dealing with open password encrypted workbooks.

Description

For the following task Use this property/method

Inspect an unopened workbook for an open password.

Note
Note

When using the method with the Stream argument and the check is performed, this method will reset the stream position to the original value if Stream.CanSeek is true.

Load a workbook encrypted with an open password.

Note
Note

If the password is supplied both as string and SecureString (in the WorkbookLoadOptions argument), the one of type string will be used, because it requires no permission to obtain the string value.

Inspect an opened workbook for an open password.

Note
Note

This property returns true if the necessary open password was supplied and the file was opened successfully. This property also returns true if a subsequent save will save the workbook with an open password.

Set, change or clear the open password on an opened workbook.

Note
Note

If you provide null or empty string, this will clear the current open password.

Operate with Write Protected Workbook

Overview

The following table lists the properties and methods associated with dealing with write protected workbooks.

Description

For the following task Use this property/method

Inspect an opened workbook for write protection.

Note
Note

This property indicates whether subsequently saved files will be write protected. You can only save write protected files when the correct password is validated using the ValidateFileWriteProtectionPassword or a new password is set using SetFileWriteProtectionPassword.

Check an opened workbook whether it has write protection and is the password validated.

Note
Note

This property returns true only if the opened workbook is write protected and the required password is still not provided. You should not allow automatic saves to the original location when this property returns true. If the correct password is provided this property will return false.

Validate the write protection password of an opened workbook.

Note
Note

These methods return true if the workbook is write protected and the provided password was correct. The provided password will be cached and will be used for subsequent saves.

Set, change or clear the write protection password on an opened workbook.

Note
Note

If you provide null or empty string, this will clear the current write protection password.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to save a Workbook object as an Excel file.