Reputation: 3272
I am using columnFormats()
to format a column as a date:
public function columnFormats(): array
{
return [
'C' => NumberFormat::FORMAT_DATE_DDMMYYYY
];
}
But it also highlights the formatted column on the exported excel file whenever it's first opened:
Is it possible to remove this highlighting?
Upvotes: 0
Views: 37
Reputation: 3272
If anyone ever encounters this in the future, this is how I solved it:
public function registerEvents(): array {
return [
AfterSheet::class => function (AfterSheet $event) {
$event->sheet->setSelectedCells('A1');
},
];
}
I select the first cell in the sheet and it removes the highlighting
Upvotes: 0