Forum


Replies: 3   Views: 88
Microsoft excel files of different version do not read files

Posted by fairshareitservices  · 10-04-2024 - 08:25

Hello,

We are reading excel files created Excel 2016 version and it is working perfectly. But now we are using Excel 2019 version and file stop reading. It shows error like PHP Warning:  Trying to access array offset on the value of type null in D:\laravel\xxxxx\xxxxx\xxxxxx.php on line 691.  Reading file and passing array Null. 

Does the library support Excel 2019?

Sample code of reading excel - Working fine for excel 2016 but not excel 2019 files

$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();

//Get Mapping table columns and row index of scheme code
    $mappingSpreadsheet = $reader->load("$INPUT_DIRECTORY/$mappingFileName");

    $mappingSpreadsheetData=$mappingSpreadsheet->getActiveSheet()->toArray();