You are here

public function PHPExcel::setActiveSheetIndexByName in Loft Data Grids 7.2

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

Set active sheet index by name

Parameters

string $pValue Sheet title:

Return value

PHPExcel_Worksheet

Throws

PHPExcel_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel.php, line 704

Class

PHPExcel
PHPExcel

Code

public function setActiveSheetIndexByName($pValue = '') {
  if (($worksheet = $this
    ->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) {
    $this
      ->setActiveSheetIndex($this
      ->getIndex($worksheet));
    return $worksheet;
  }
  throw new PHPExcel_Exception('Workbook does not contain sheet:' . $pValue);
}