Options for Worksheet


-b R

Syntax: layer -b R value

Set worksheet as editable or read-only. Value = 0 for editing worksheet. Value = 1 for read-only worksheet.


Syntax: layer -les value

Set editable cells on a protected worksheet:
When data protection is turned on in the worksheet(layer -lw 2), all the cells locked to editing. To edit specific cells on a protected worksheet, set the cell block as editable before protecting the worksheet.

value Action
0 Clear all editable cell blocks from active sheet.
1 Set the active, selected cell blocks to editable.
2 List the editable cell blocks in the active sheet.
Note: Layer -les 0 or Layer -les 1 fails when the worksheet has been protected. You need to set cell blocks as editable before protecting the sheet.
worksheet -s 2 1 2 4; // Select row 1 to row 4 in column 2.
layer -les 1; // Set active selection of cell block to editable before turning on data protection.
layer -lw 2; // Turn on data protection in the active sheet.
layer -les 2; // List the editable cell blocks in the active sheet.


Syntax: layer -lt

print the current protection bits


Syntax: layer -lw hex(hex value)

Turn on protection on worksheet level:

Hex Value Description
-- Turn on all protection bits
0 Remove all protections on the active worksheet.
2 Data Protection: This includes all cells in a worksheet (data cells and label cells).
80 Structure Protection: Keep the columns in the sheet unchanged. Prevent insert/delete of columns or moving of columns. However, allow rows to be changed.
100 Rename Protection: Prevent renaming of the sheet.
400 Delete Protection: Prevent the worksheet from being deleted.
Note: Multiple protection flags can be applied (values are additive).
lay -lw hex(82); //Prevent editing data and modifying structure of the active sheet.
lay -lw hex(180); //Prevent modifying structure and renaming the active sheet.


Syntax: layer -s

Update Origin when you change sheet activity in an Excel workbook:
Only for use with an Excel sheet embedded in Origin. Make the top Excel sheet the active layer in Origin. Execute layer -s after making a new Excel sheet active, or after adding a new sheet to the Excel workbook.


Syntax: layer -se sheetName

Set the named Excel sheet as the active layer:
Same as layer -s, but makes the named sheet (rather than the top sheet) active.


Syntax: layer -trv value

Switch worksheet to column list view. 1 = true, 0 = false.


Syntax: layer -us

Update active Excel sheet and copy data:
Similar to layer -s, but performs a full update of new Excel sheet information and data to Origin's hidden sheet. A full update means updating the sheet name, the number of columns, and the sheet data.


Syntax: layer -usn

Update active Excel sheet, do not copy data:
Same as layer -us, but does only a partial update; copies sheet information, but does not copy data.


Syntax: layer -w wks [c1 r1 c2 r2] [graphType]

Specify the beginning and ending column and row numbers:
When no range is specified, plot the entire worksheet wks into the active layer. To select a worksheet range, specify the beginning and ending column and row numbers. If c1 and c2 = 0, plot all columns. If r1 and r2 = 0, plot all rows. The graphType value (graphType values can be found under the worksheet -p command) determines graph type: line, symbol, scatter, etc. If graphType = "?", the graph type that has been saved with the layer is used.