I really don't know what it could be.
But have you checked if you have some strange values for some addresses ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a simple export however when trying to add the address column to the export now it doesn't work. I get an error that is very vague to me and I can't really figure out what is going on. Unable to access External Workbook that's all I get, the error only points to internal files not my code itself.
Here is the full file
class SalePointsExport implements FromQuery, ShouldAutoSize, WithMapping, WithHeadings, WithStyles, WithColumnFormatting
{
use \Maatwebsite\Excel\Concerns\Exportable;
private $fileName = 'sale_points.xlsx';
private $writerType = Excel::XLSX;
protected $request = null;
public function __construct(Request $request)
{
$this->request = $request;
}
public function query()
{
$salePoint = SalePoint::with('format.chain.channel', 'distributor', 'type', 'seller', 'salePoint.district.canton.province.country');
$salePoint->search(
['client_name', 'code', 'format.description', 'type.name', 'distributor.description', 'seller.name'],
$this->request->input('search')
);
$salePoint->filter($this->request->input('relations'));
$salePoint->trashed($this->request->input('soft_delete'));
$salePoint->order($this->request->input('sort_col'));
return $salePoint;
}
public function headings(): array
{
return [
'Nombre',
'Dirección',
'Distrito',
'Canton',
'Provincia',
'País',
'Formato',
'Cadena',
'Canal',
'Distribuidor',
'Vendedor',
'Tipo de Punto de Venta',
'Fecha de Creación'
];
}
public function map($row): array
{
Log::info($row->address);
return [
$row->client_name ?? $row->sale_point?->name,
strval($row->address),
$row->salePoint?->district?->name,
$row->salePoint?->district?->canton?->name,
$row->salePoint?->district?->canton?->province?->name,
$row->salePoint?->district?->canton?->province?->country?->name,
$row->format->description,
$row->format->chain->description,
$row->format->chain->channel->description,
$row->distributor?->description,
$row->seller?->name,
$row->type?->name,
Date::dateTimeToExcel($row->created_at)
];
}
public function styles(Worksheet $sheet)
{
$sheet->getStyle('1')->getFont()->setBold(true);
$sheet->getStyle('1')->getFont()->setSize(12);
}
public function columnFormats(): array
{
return ['M' => NumberFormat::FORMAT_DATE_DDMMYYYY];
}
}
I originally though that the problem was because the excel is large over 11k lines but if I remove the address line it downloads all 11k+ lines no problem.
The address is literally just a regular string, I even tried converting it to string just o see what happens but nothing seems to work.
Another thing is that Log I have there, it logs all 11k items but fails either on the last one or when it's all done since it doesn't download but it did loop through all of them.
How can I fix this?
I really don't know what it could be.
But have you checked if you have some strange values for some addresses ?
Please or to participate in this conversation.