Forum


Replies: 3   Views: 72
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();

 

Posted by admin  · 10-04-2024 - 08:32

Hello,

Please note that this is a phpdocx forum. And also for phpxlsx and phppptx products (phpdocx Bureau includes them). phpxlsx works with XLSX files and phppptx works with PPTX files.

PhpSpreadsheet is not a phpdocx product. Please contact them for support.

Regards.

Posted by fairshareitservices  · 10-04-2024 - 12:07

Okay but we are using Perium version and we don't want to use multiple libraries. Can you suggest excel reading class or feature of this Phpdocx product?

Posted by admin  · 10-04-2024 - 12:10

Hello,

phpxlsx is available in phpdocx Bureau licenses or as a standalone library (https://www.phpxlsx.com/). phpxlsx is not included in phpdocx Premium as you can read of the features page (https://www.phpdocx.com/features) and the pricing page (https://www.phpdocx.com/pricing).

If you want to use phpxlsx you need to upgrade to phpdocx Bureau or buy it as standalone library.

phpdocx Premium includes some specific methods to work with XLSX and PPTX files you can read on https://www.phpdocx.com/documentation/api-documentation. But it's recommended to use phpxlsx to work with XLSX files and phppptx to work with PPTX files, that are full libraries to work with these file types.

Regards.