I'm having trouble styling cells in a worksheet object that doesn't yet belong to a spreadsheet object. Is this possible? It doesn't appear to be possible using the getStyle() method since this method calls functions in the parent spreadsheet. Maybe there is another method?
Worksheet class:
class MyWorksheet extends \PHPOffice\PHPSpreadsheet\Worksheet\Worksheet {
public function something() {
$this->setCellValue('A1', 'Something');
$this->getStyle('A1')->ApplyFromArray([
'font' => ['bold' => true]
]);
}
}
When something() is executed it results in a setActiveSheetIndex() on null exception.