Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft excel files of different version do not read files #3979

Open
rupaliipte opened this issue Apr 11, 2024 Discussed in #3978 · 1 comment
Open

Microsoft excel files of different version do not read files #3979

rupaliipte opened this issue Apr 11, 2024 Discussed in #3978 · 1 comment

Comments

@rupaliipte
Copy link

Discussed in #3978

Originally posted by rupaliipte April 10, 2024
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();

Thank You

@MarkBaker
Copy link
Member

MarkBaker commented Apr 12, 2024

PhpSpreadsheet is tested with files generated using a variety of Excel versions, including 2016, 2019, 2021 and 365, but not tested against every conceivable feature of Excel in every version. If it is failing to read a valid Excel file, it's because that file contains something that it doesn't understand, but without seeing an example file to demonstrate and debug a problem, we can't identify exactly what that might be.

Note that I can't guess what file D:\laravel\xxxxx\xxxxx\xxxxxx.php might be, nor what is at line 691 of that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants