Hi,
You can protect the Sheet or Cell using the locked
property; unfortunately password property is not available with C1Excel. Here is
the code to lock -
' Start with a single locked sheet.
_c1xl.Clear()
Dim sheet As XLSheet = _c1xl.Sheets(0)
sheet.Locked = True
' Create an unlocked
style.
Dim dataEnTry As XLStyle = New XLStyle(_c1xl)
dataEnTry.Locked = False
dataEnTry.BackColor = Color.Beige
' Create data entry
titles.
sheet(0,0).Value = "Name:"
sheet(1,0).Value = "Address:"
sheet(2,0).Value = "Phone #:"
' Create data enTry
cells (unlocked).
sheet(0,1).Style = dataEnTry
sheet(1,1).Style = dataEnTry
sheet(2,1).Style = dataEnTry
' Save the
book.
_c1xl.Save("c:\temp\Protected.xls")
Thanks,
Gary.
Hi!
Is
it possible to protect (unprotect) a cell, row, column or any other range of
worksheet from editing at runtime (like worksheet.Protect in MS Excel)?
Is
it possible to use passwords for protection of workbook
(worksheet)?
Thanks!
http://helpcentral.componentone.com/cs/forums/p/74209/201638.aspx#201638