vb.net - Protecting columns in excel using C# -
i attempting write excel sheet data , after writing in necessary data, protect cells against editing making them non editable. after operation, data updated on unprotected cells sheet users use , read carry out processing activity.
- can me out specifically, how lock column editing in excel?
- how write using c# protected column?
- how read using c# protected column?
simple references examples me out greatly. ps: if more comfortable vb.net references of how on helpful.
for excel cell in non-editable mode 2 things have taken care of:
1) excel cell should locked
ws.get_range("location", type.missing).locked = true;
2) excel worksheet should locked
ws.protect("securitycode", true, true, true, type.missing, type.missing, true, true, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing); //where ws worksheet object
for second question read through protected cell, can done directly
string cellvalue = ws.get_range("location", type.missing).value2.tostring(); //now depending upon cellvalue can write own logic.
Comments
Post a Comment