Skip to main content

Create(string) Constructor

Creates a new instance of a spreadsheet protection provider.

Declaration

constructor Create(const APassword: string); overload;

Parameters

Name Type
APassword string

Remarks

Call this constructor to create an instance of the standard or strong spreadsheet protection provider, initializing the Password property with the value passed as the APassword parameter.

To enforce the spreadsheet document structure or worksheet password protection, assign the newly created protection provider to the OptionsProtection.ProtectionInfo property provided by the Spreadsheet/Report Designer control or a Table View worksheet, respectively:

var
  AProtectionInfo: IdxSpreadSheetProtectionInfo;
//...
  AProtectionInfo := TdxSpreadSheetStandardProtectionInfo.Create('Password');  // Create a standard protection provider with the required password
  dxSpreadSheet1.OptionsProtection.ProtectionInfo := AProtectionInfo;
  dxSpreadSheet1.OptionsProtection.&Protected := True;  // Enable the document structure's protection

For more information, refer to the Spreadsheet Document Structure Protection and Worksheet Protection sections of the Password Protection topics.

See Also