Skip to content

Exception: You must specify a worksheet or a scope for a Named Range #1723

@ghost

Description

This is a bug report

What is the expected behavior?

Read an xlsx file of approximately 47000 rows.
sat.xlsx

What is the current behavior?

error 1
image
error 2
image

What are the steps to reproduce?

<?php
# error 1
require_once("vendor/autoload.php");
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
$reader = new Xlsx();
$reader->load("sat.xlsx");
?>
<?php
# error 2
require_once("vendor/autoload.php");
$file_type = null;
$reader = null;
$spreadsheet = null;
$data = null;
$rutaArchivo = "sat.xlsx";
$libro = 0;
$file_type = PhpOffice\PhpSpreadsheet\IOFactory::identify($rutaArchivo);
$reader = PhpOffice\PhpSpreadsheet\IOFactory::createReader($file_type);
$isReadDataOnly = $reader -> getreadDataOnly();
$spreadsheet = $reader->load($rutaArchivo);
$data = $spreadsheet->getActiveSheet($libro)->toArray();
var_dump( count($data) );
die();
?>

Which versions of PhpSpreadsheet and PHP are affected?

PhpSpreadsheet 1.15.0.0
PHP 7.4.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions