1. Error: Class “Vtiful\Kernel\Excel” not found.
2. The reason is that the php-ext-xlswriter extension is not installed.
3. Downloaded php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip from the GitHub Release page: https://github.com/viest/php-ext-xlswriter/releases . As shown in Figure 1

4. After extracting, copy php_xlswriter.dll to C:\php-8.1.27\ext\php_xlswriter.dll
5. Edit php.ini and add extension=xlswriter
6. After restarting PHP, the following error occurred again: [ERROR] workbook_close(): Error creating ‘E:\wwwroot\object\storage\app\export/order/订单导出任务2024-02-19 10:24:06.xls’. Error = No error. As shown in Figure 2
![After restarting PHP, the following error occurred again: [ERROR] workbook_close(): Error creating 'E:\wwwroot\object\storage\app\export/order/订单导出任务2024-02-19 10:24:06.xls'. Error = No error](https://media.shuijingwanwq.com/2024/03/2-1.png)
7. Checked the exception details in the failed_jobs table: ErrorException: fopen(E:\wwwroot\object\storage\app\export/order/订单导出任务2024-02-19 10:24:06.xls): Failed to open stream: No such file or directory in
$path = Storage::disk($this->disk)->putFileAs(
$this->basePath,
$this->excel->output(),
basename($this->excel->{'localFileName'})
);
ErrorException: fopen(E:\wwwroot\object\storage\app\export/order/订单导出任务2024-02-19 10:24:06.xls): Failed to open stream: No such file or directory in E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php:396
Stack trace:
#0 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(259): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fopen(E:\\wwwroo...', 'E:\\wwwroot\\erp-...', 396)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'fopen(E:\\wwwroo...', 'E:\\wwwroot\\erp-...', 396)
#2 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php(396): fopen('E:\\wwwroot\\erp-...', 'r')
#3 E:\wwwroot\object\app\Services\ExportService.php(81): Illuminate\Filesystem\FilesystemAdapter->putFileAs('export/order', 'E:\\wwwroot\\erp-...', '\xE8\xAE\xA2\xE5\x8D\x95\xE5\xAF\xBC\xE5\x87\xBA\xE4\xBB\xBB...')
#4 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(593): App\Services\ExportService->save()
#5 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(230): Modules\Order\Services\OrderExportService->exportCheck(Array, Array, '\xE8\xAE\xA2\xE5\x8D\x95\xE5\xAF\xBC\xE5\x87\xBA\xE4\xBB\xBB...')
#6 E:\wwwroot\object\Modules\Order\Jobs\OrderExportJob.php(52): Modules\Order\Services\OrderExportService->exportOrderExcel(Array, Object(App\Models\JobStatus))
#7 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Modules\Order\Jobs\OrderExportJob->handle()
#8 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#9 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#10 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#11 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#12 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#13 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#14 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#15 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#16 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(124): Illuminate\Bus\Dispatcher->dispatchNow(Object(Modules\Order\Jobs\OrderExportJob), false)
#17 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#18 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#19 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(126): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#20 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Modules\Order\Jobs\OrderExportJob))
#21 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#22 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(425): Illuminate\Queue\Jobs\Job->fire()
#23 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(375): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#24 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(173): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#25 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(150): Illuminate\Queue\Worker->daemon('redis', 'export_queue', Object(Illuminate\Queue\WorkerOptions))
#26 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(134): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'export_queue')
#27 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#28 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#29 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#30 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#31 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#32 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(144): Illuminate\Container\Container->call(Array)
#33 E:\wwwroot\object\vendor\symfony\console\Command\Command.php(312): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#34 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(126): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#35 E:\wwwroot\object\vendor\symfony\console\Application.php(1022): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 E:\wwwroot\object\vendor\symfony\console\Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 E:\wwwroot\object\vendor\symfony\console\Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Application.php(102): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#39 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(151): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 E:\wwwroot\object\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 {main}
8. Decided to download from the official PHP website: https://pecl.php.net/package/xlswriter/1.5.1/windows . 8.1 Thread Safe (TS) x64.
9. Error: Worksheet row or column index out of range. Reference: Exception code list. https://xlswriter-docs.viest.me/zh-cn/exception/code . The row or column index of the worksheet exceeds the range specified by Excel. Please check the array key values. As shown in Figure 3

Vtiful\Kernel\Exception: Worksheet row or column index out of range. in E:\wwwroot\object\app\Services\ExportService.php:107
Stack trace:
#0 E:\wwwroot\object\app\Services\ExportService.php(107): Vtiful\Kernel\Excel->data(Array)
#1 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(581): App\Services\ExportService->writeRows(Array)
#2 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(230): Modules\Order\Services\OrderExportService->exportCheck(Array, Array, '\xE8\xAE\xA2\xE5\x8D\x95\xE5\xAF\xBC\xE5\x87\xBA\xE4\xBB\xBB...')
#3 E:\wwwroot\object\Modules\Order\Jobs\OrderExportJob.php(52): Modules\Order\Services\OrderExportService->exportOrderExcel(Array, Object(App\Models\JobStatus))
#4 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Modules\Order\Jobs\OrderExportJob->handle()
#5 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#7 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#8 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#9 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#10 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#11 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#12 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#13 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(124): Illuminate\Bus\Dispatcher->dispatchNow(Object(Modules\Order\Jobs\OrderExportJob), false)
#14 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#15 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#16 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(126): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#17 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Modules\Order\Jobs\OrderExportJob))
#18 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#19 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(425): Illuminate\Queue\Jobs\Job->fire()
#20 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(375): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#21 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(173): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#22 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(150): Illuminate\Queue\Worker->daemon('redis', 'export_queue', Object(Illuminate\Queue\WorkerOptions))
#23 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(134): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'export_queue')
#24 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#25 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#26 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#27 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#28 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#29 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(144): Illuminate\Container\Container->call(Array)
#30 E:\wwwroot\object\vendor\symfony\console\Command\Command.php(312): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#31 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(126): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#32 E:\wwwroot\object\vendor\symfony\console\Application.php(1022): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 E:\wwwroot\object\vendor\symfony\console\Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 E:\wwwroot\object\vendor\symfony\console\Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Application.php(102): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(151): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 E:\wwwroot\object\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 {main}
Next Vtiful\Kernel\Exception: Worksheet row or column index out of range. in E:\wwwroot\object\app\Services\ExportService.php:107
Stack trace:
#0 E:\wwwroot\object\app\Services\ExportService.php(107): Vtiful\Kernel\Excel->data(Array)
#1 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(581): App\Services\ExportService->writeRows(Array)
#2 E:\wwwroot\object\Modules\Order\Services\OrderExportService.php(230): Modules\Order\Services\OrderExportService->exportCheck(Array, Array, '\xE8\xAE\xA2\xE5\x8D\x95\xE5\xAF\xBC\xE5\x87\xBA\xE4\xBB\xBB...')
#3 E:\wwwroot\object\Modules\Order\Jobs\OrderExportJob.php(52): Modules\Order\Services\OrderExportService->exportOrderExcel(Array, Object(App\Models\JobStatus))
#4 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Modules\Order\Jobs\OrderExportJob->handle()
#5 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#7 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#8 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#9 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#10 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#11 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#12 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#13 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(124): Illuminate\Bus\Dispatcher->dispatchNow(Object(Modules\Order\Jobs\OrderExportJob), false)
#14 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#15 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Modules\Order\Jobs\OrderExportJob))
#16 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(126): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#17 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Modules\Order\Jobs\OrderExportJob))
#18 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#19 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(425): Illuminate\Queue\Jobs\Job->fire()
#20 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(375): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#21 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(173): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#22 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(150): Illuminate\Queue\Worker->daemon('redis', 'export_queue', Object(Illuminate\Queue\WorkerOptions))
#23 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(134): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'export_queue')
#24 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#25 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#26 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#27 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#28 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Container\Container.php(651): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#29 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(144): Illuminate\Container\Container->call(Array)
#30 E:\wwwroot\object\vendor\symfony\console\Command\Command.php(312): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#31 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Command.php(126): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#32 E:\wwwroot\object\vendor\symfony\console\Application.php(1022): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 E:\wwwroot\object\vendor\symfony\console\Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 E:\wwwroot\object\vendor\symfony\console\Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Console\Application.php(102): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 E:\wwwroot\object\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(151): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 E:\wwwroot\object\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 {main}
10. Finally found the cause: the $data array in $this->excel->data($data); is an associative array. When it was changed to an indexed array, the error “Worksheet row or column index out of range.” no longer occurred. However, the error “[ERROR] workbook_close(): Error creating” continued. Ultimately, I decided not to modify the code and continued using php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64, which automatically supports associative arrays.
[
{
"plat_order_no": "GM20240204031613_3",
"transaction_no": "202402041"
}
]
[
[
"GM20240204031613_3",
"202402041"
]
]
11. Finally identified the direct cause: the Excel file was not generated successfully during output(). The root cause is that the parameter in fileName(); contained : , which prevented the Excel file from being generated. Renaming an xls file to: 订单导出任务2024-02-19 17:42:32 will automatically adjust it to: 订单导出任务2024-02-19 174232. Prompt: A file name cannot contain any of the following characters: \\:*?”<<>| . As shown in Figure 4

12. After replacing : in the file name with _ . The Excel file was exported successfully.
