Sets active sheet and active cells of xlsx files.
Use composer.
$ composer require nanaweb/excel-selection-setter
Select first cell in each sheet, first sheet of the workbook.
<?php
use Nanaweb\ExcelSelectionSetter\ExcelSelectionSetter;
use Nanaweb\ExcelSelectionSetter\Strategy\AllFirst;
$setter = new ExcelSelectionSetter();
$setter->addStrategy(new AllFirst());
$setter->execute($pathToYourXlsx, 'all_first');
Select the sheet which is selected in the template, cells which are selected in the template.
<?php
use Nanaweb\ExcelSelectionSetter\ExcelSelectionSetter;
use Nanaweb\ExcelSelectionSetter\Strategy\SynchronizeToTemplate;
$setter = new ExcelSelectionSetter();
$setter->addStrategy(new SynchronizeToTemplate());
$setter->execute($pathToYourXlsx, 'synchronize_to_template');
Any classes which implement StrategyInterface
are accepted as strategy.