You are here

public function PHPExcel_Worksheet::protectCells in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php \PHPExcel_Worksheet::protectCells()

Set protection on a cell range

Parameters

string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1):

string $pPassword Password to unlock the protection:

boolean $pAlreadyHashed If the password has already been hashed, set this to true:

Return value

PHPExcel_Worksheet

Throws

PHPExcel_Exception

1 call to PHPExcel_Worksheet::protectCells()
PHPExcel_Worksheet::protectCellsByColumnAndRow in vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php
Set protection on a cell range by using numeric cell coordinates

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php, line 1808

Class

PHPExcel_Worksheet
PHPExcel_Worksheet

Code

public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) {

  // Uppercase coordinate
  $pRange = strtoupper($pRange);
  if (!$pAlreadyHashed) {
    $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword);
  }
  $this->_protectedCells[$pRange] = $pPassword;
  return $this;
}