Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:28:29+00:00 2026-06-13T13:28:29+00:00

I want to generate an array from my xlsx file first, before I insert

  • 0

I want to generate an array from my xlsx file first, before I insert it to Mysql, so I am using phpexcel because this one is good enough (I know it from every website’s review). But there is a problem when I am trying to making an array from the xlsx defined sheet, here is my script :

<?php

error_reporting(E_ALL);
set_time_limit(0);

date_default_timezone_set('Europe/London');

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Automatic Importer</title>

</head>
<body>

<h1>PHPExcel Reader Example #07</h1>
<h2>Simple File Reader Loading a Single Named WorkSheet</h2>
<?php

/** PHPExcel_IOFactory */
include 'Classes/PHPExcel/IOFactory.php';


//$inputFileType = 'Excel5';
    $inputFileType = 'Excel2007';
//  $inputFileType = 'Excel2003XML';
//  $inputFileType = 'OOCalc';
//  $inputFileType = 'Gnumeric';
$inputFileName = 'file.xlsx';
$sheetname = 'My Sheet 4';

echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
echo 'Loading Sheet "',$sheetname,'" only<br />';
$objReader->setLoadSheetsOnly($sheetname);
$objPHPExcel = $objReader->load($inputFileName);


echo '<hr />';

echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />';
$loadedSheetNames = $objPHPExcel->getSheetNames();
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
var_dump($sheetData);


?>
<body>
</html>

and this is the error says :

Fatal error: Call to a member function cellExists() on a non-object in C:\xampp\htdocs\chi\import\Classes\PHPExcel\Calculation.php on line 3241

Can someone tell where is the error is? My OOP is not good, thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:28:30+00:00Added an answer on June 13, 2026 at 1:28 pm

    The problem is something in one of the spreadsheet formulae that PHPExcel is having problems evaluating, when you call toArray() with the 3rd argument as TRUE telling the method to evaluate all the formulae in the worksheet. I did add a fix to this last night where a named range containing a reference to a non-existent cell is used in a formula… a bug that would trigger this message; but in this case (with the error at that particular line number) it looks as though it could be a formula that references a non-existent worksheet. The fact that you’re only loading a single named worksheet makes this quite possible.

    If possible, can you “walk the spreadsheet”, using getCalculatedValue() on each cell to find which cell contains the formula that is triggering the error; and then see what that formula is?

    Alternatively, load the entire workbook rather than just the one individual worksheet, and see if the error still occurs then.

    I’ll look at patching the calculation engine code to prevent this error; but it does mean that the formula can’t be correctly evaluated if a sheet that it references isn’t accessible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate array position from 1 to 1000 randomly using some mathematical
I want to generate an url like this: /photo?tags=tag1,tag2,tag3 routes file: GET /photo controllers.Photos.list(tags:Array[String]
I want to generate a bar graph from from a csv file my data
I want to generate an array that has 144 number from 1->36 in random
Using Wordpress, I need to generate an array of tags(terms) from posts in a
I have source array, and I want to generate new array from the source
I want to generate the lines, which I get from an array in 3D.
I want to generate the array $result_array. There is no error at the page,
I want to generate an HTML table from a couple specified parameters. Specifically, the
I want to generate strong types based on weakly typed data sources, using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.