[]
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.
public bool ValidatePassword(string password)
Public Function ValidatePassword(password As String) As Boolean
| Type | Name | Description |
|---|---|---|
| string | password | The password to validate. |
| Type | Description |
|---|---|
| bool |
true
if the specified password matches the workbook write-protection password, or if the workbook is not write protected; otherwise, false.
|
WriteProtection protection = workbook.WriteProtection;
string password = GetPasswordFromSecureSource();
protection.WritePassword = password;
bool isValid = protection.ValidatePassword(password);