'Declaration Public Overloads Sub Protect( _ ByVal password As System.String, _ Optional ByVal allowEditObjects As System.Nullable(Of Boolean), _ Optional ByVal allowEditContents As System.Nullable(Of Boolean) _ )
public void Protect( System.string password, System.Nullable<bool> allowEditObjects, System.Nullable<bool> allowEditContents )
When a Chartsheet is protected without a password, the end user may unprotect the Chartsheet in Excel without having to supply a password. To programatically unprotect a Chartsheet, one may use the Sheet.Unprotect method.
The optional parameters are used to update the property values of the Infragistics.Documents.Excel.Charts.ChartsheetProtection instance from this Chartsheet's Protection property. If the parameter is null, the current value of the associated property will be retained; otherwise the property will be updated with the specified value. For example, if the Infragistics.Documents.Excel.Charts.ChartsheetProtection.AllowEditObjects is currently true and the allowEditObjects is null, then the property will continue to be true but if the allowEditObjects is false the Infragistics.Documents.Excel.Charts.ChartsheetProtection.AllowEditObjects will be changed to false.
Note: If Sheet.IsProtected is already true, the method will be ignored.
Target Platforms: Windows 8.1, 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
Chartsheet Class
Chartsheet Members
Overload List
HasProtectionPassword Property
IsProtected Property
Protection Property
ChartsheetProtection Class
Protect(Nullable<Boolean>,Nullable<Boolean>) Method
Protect(SecureString,Nullable<Boolean>,Nullable<Boolean>) Method
Unprotect Method
Unprotect(String) Method
View on GitHub