boy108zon
boy108zon

Reputation: 15

PHPExcel function showing error on php version 8

I upgrading my website from php 5.6 to php 8 , i am working on changing the PHPexcel to run in php 8 but getting below issue any idea to fix it

try {
        $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
        $objReader     = PHPExcel_IOFactory::createReader($inputFileType);
        $objPHPExcel   = $objReader->load($inputFileName);
                    $objReader->setReadDataOnly(true);
    }
    catch (Exception $e) {
        die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage());
    }
            
            
            $worksheetData = $objReader->listWorksheetInfo($inputFileName);

these below lines working and returning valid response

$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
        $objReader     = PHPExcel_IOFactory::createReader($inputFileType);
        $objPHPExcel   = $objReader->load($inputFileName);
                    $objReader->setReadDataOnly(true);

Upvotes: 0

Views: 4176

Answers (0)

Related Questions