SpreadsheetGear 2012
Protect Method (IWorkbook)






The password which will be required to unprotect the workbook.
Specifies whether the structure (number and order of worksheets) of this workbook may be changed.
Specifies whether the windows of this workbook are protected from changes.
Enables protection for this workbook with the specified password and protection options.
Syntax
'Declaration
 
Sub Protect( _
   ByVal password As System.String, _
   ByVal protectStructure As System.Boolean, _
   ByVal protectWindows As System.Boolean _
) 
'Usage
 
Dim instance As IWorkbook
Dim password As System.String
Dim protectStructure As System.Boolean
Dim protectWindows As System.Boolean
 
instance.Protect(password, protectStructure, protectWindows)
void Protect( 
   System.string password,
   System.bool protectStructure,
   System.bool protectWindows
)
procedure Protect( 
    password: System.String;
    protectStructure: System.Boolean;
    protectWindows: System.Boolean
); 
function Protect( 
   password : System.String,
   protectStructure : System.boolean,
   protectWindows : System.boolean
);
void Protect( 
   System.string* password,
   System.bool protectStructure,
   System.bool protectWindows
) 
void Protect( 
   System.String^ password,
   System.bool protectStructure,
   System.bool protectWindows
) 

Parameters

password
The password which will be required to unprotect the workbook.
protectStructure
Specifies whether the structure (number and order of worksheets) of this workbook may be changed.
protectWindows
Specifies whether the windows of this workbook are protected from changes.
Requirements

Target Platforms: 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

Reference

IWorkbook Interface
IWorkbook Members
Unprotect Method
ProtectStructure Property
ProtectWindows Property
ProtectContents Property
Protect Method
Unprotect Method

Send Feedback