Skip to main content

lock()

locks the specified cell

lock: (cell: string) => void;

Parameters:

cell: string - the id(s) of a cell(s) or a range of cells

Example

// locks a cell
spreadsheet.lock("A1");

// locks a range of cells
spreadsheet.lock("A1:C1");

// locks specified cells
spreadsheet.lock("A1,B5,B7,D4:D6");

Related sample: Spreadsheet. Locked Cells

Starting with v4.1, the reference to a cell or a range of cells can be specified in the following format:

spreadsheet.lock("sheet1!A2"); 

where sheet1 is the name of the tab.

In case the name of the tab isn't specified, the method will lock the cell(s) of the active tab.