How to set active sheet without loading an xlsx file?

前端 未结 4 729
执笔经年
执笔经年 2021-02-09 15:48

I am using PHPExcel to generate an xl using php. I am not loading an xl sheet but creating new sheets using

$phpExcel = new PHPExcel();
$phpExcel-&g         


        
4条回答
  •  生来不讨喜
    2021-02-09 16:40

    Add below function into Excel.php class file:

    function setActiveSheet($sheetnumber) {
            $this->objPHPExcel->setActiveSheetIndex($sheetnumber);
        }
    

    then call that function like this :

    $phpExcel->setActiveSheet(0);
    

提交回复
热议问题