I
I
Ilya2018-12-02 13:38:37
PHP
Ilya, 2018-12-02 13:38:37

How can PhpSpreadsheet write to other sheets?

There is an excel template in it several sheets, you need to write as for example in phpexcel
First sheet
$aSheet = $objPHPExcel->setActiveSheetIndex(0);
second sheet
$aSheet1 = $objPHPExcel->setActiveSheetIndex(1);
etc.
In PhpSpreadsheet this syntax does not work(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Ermilichev, 2018-12-02
@From11

Works

$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); 
$spreadsheet->setActiveSheetIndex(0);
$activeSheet = $spreadsheet->getActiveSheet();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question