[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.WriteProtection.ValidatePassword

ValidatePassword Method

ValidatePassword(string)

Validates the specified password against the workbook write-protection password.

Use this method to check whether a password matches the password set by WritePassword. If the workbook is not write protected, this method returns true.

Declaration
public bool ValidatePassword(string password)
Public Function ValidatePassword(password As String) As Boolean
Parameters
Type Name Description
string password

The password to validate.

Returns
Type Description
bool true if the specified password matches the workbook write-protection password, or if the workbook is not write protected; otherwise, false.
Examples
WriteProtection protection = workbook.WriteProtection;
string password = GetPasswordFromSecureSource();
protection.WritePassword = password;
bool isValid = protection.ValidatePassword(password);