Hello everyone!
I'm looking for a way to import an excel spreadsheet to use with a plugin I'm developping. I realised that Moodle comes with PhpSpreadSheet and thought it might do the job for what I have in mind.
What I need to do is read from (and eventually write to) the spreadsheet I mentionned. Essentially, I'm trying to use the spreadsheet to display a specific cell in my block. Looking at the PhpSpreadSheet documentation I found this sample code :
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');
$writer = new Xlsx($spreadsheet);
$writer->save('hello world.xlsx');
The problem i'm encountering is that I can't find the proper way to initiate the Spreadsheet class. I'm suspecting that the use/require statements should be modified and tried multiple variations, but to no avail.
I'm obviously inexperienced at web developpment so I thought I'd ask here to save some time. I apologize if this isn't an appropriate place to ask.