let sheet = spread.getActiveSheet();
for(let row=0;row<sheet.getRowCount();row++){
for(let col=0;col<sheet.getColumnCount();col++){
let cell=sheet.getCell(row,col)
let style=sheet.getStyle(row,col,GC.Spread.Sheets.SheetArea.viewport, true);
if(cell.backColor()!=BACKCOLOR){
if(cell.formula()!=null && cell.formula()!=""){
style.locked = true;
sheet.getCell(row, col).locked(true)
sheet.setStyle(row, col, style);
}
}else{
style.locked = false;
sheet.getCell(row, col).locked(false)
sheet.setStyle(row, col, style);
}
}
}
sheet.options.isProtected = true;
|
|