Syncfusion.XlsIO.Base
Example 


Represents a password to protect with.

Protect(String) Method

Protects a sheet with specified password so that it cannot be modified.
Syntax
'Declaration
 
Overloads Sub Protect( _
   ByVal password As String _
) 
'Usage
 
Dim instance As ITabSheet
Dim password As String
 
instance.Protect(password)
void Protect( 
   string password
)

Parameters

password
Represents a password to protect with.
Example
Following code illustrates how to protect the sheet
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
ITabSheet sheet = workbook.Worksheets[0];
            
// Protect the sheet 
sheet.Protect("Syncfusion");
            
workbook.SaveAs("Protect.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also