Version

HasProtectionPassword Property (Workbook)

Returns a boolean indicating if the Workbook has been protected with a password.
Syntax
'Declaration
 
Public ReadOnly Property HasProtectionPassword As Boolean
public bool HasProtectionPassword {get;}
Remarks

When protecting a Workbook, a password is optional. The HasProtectionPassword will return true if the Workbook is currently protected (see IsProtected) and a password was specified when it was protected. To protect a Workbook without a password, one may use the Protect(Boolean,Boolean) method that doesn't take a password. To require a specific password to be entered in order to unprotect the Workbook one could use one of the other overloads that take a password (e.g.Unprotect(String)).

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also