Method: Axlsx::Worksheet#protect_range

Defined in:
lib/axlsx/workbook/worksheet/worksheet.rb

#protect_range(cells) ⇒ ProtectedRange

Note:

When using an array of cells, a contiguous range is created from the minimum top left to the maximum top bottom of the cells provided.

Adds a new protected cell range to the worksheet. Note that protected ranges are only in effect when sheet protection is enabled.

Parameters:

  • cells (String|Array)

    The string reference for the cells to protect or an array of cells.

Returns:



214
215
216
# File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 214

def protect_range(cells)
  protected_ranges.add_range(cells)
end