Issue: Cant get Calculated Value from a cell refferencing different sheet.

Topics: Developer Forum
Dec 1, 2014 at 5:50 PM
Edited Dec 1, 2014 at 6:04 PM
Hey, I'm trying for a few hours now and can't get this to work.
My excel file ( www.kegljanje.com/phpexcel1.xlsx ) has 3 sheets and I need to gather data from 2nd sheet (vollmer). Most of the cells are calculated from the 1st sheet (daten), but I cant get the calculated value of those cells.

Phpinfo is accessible on the link I provided above (full phpinfo).
PHPExcel version: 1.8.0, 2014-03-02

http://kegljanje.com/phpexcel.php

Below the php info are my outputs.

1st output is with getValue() and gives literal cell value, it works like it should.
After it there should be a 2nd output with the calculated value. The calculated value gives me an error.
Fatal error: Uncaught exception 'PHPExcel_Calculation_Exception' with message 'vollmer!M1 -> Column string index can not be empty' in /home/acfanaly/public_html/webmistik/kegljanje.com/PHPExcel/Classes/PHPExcel/Cell.php:300 Stack trace: #0 /home/acfanaly/public_html/webmistik/kegljanje.com/phpexcel.php(39): PHPExcel_Cell->getCalculatedValue() #1 {main} thrown in /home/acfanaly/public_html/webmistik/kegljanje.com/PHPExcel/Classes/PHPExcel/Cell.php on line 300
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

echo "PHP INFO<br>";
phpinfo();

echo "START PHPEXCEL<br>";
//EXCEL
$inputFileName = "phpexcel1.xlsx";

/** Include PHPExcel_IOFactory */
require_once dirname(__FILE__) . '/PHPExcel/Classes/PHPExcel/IOFactory.php';


$inputFileType = PHPExcel_IOFactory::identify($inputFileName);

$objReader = PHPExcel_IOFactory::createReader($inputFileType);



$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);

date_default_timezone_set('Europe/London');

$objWorksheet = $objPHPExcel->getActiveSheet();

//getValue()
$homeName = $objPHPExcel->getActiveSheet(0)->getCellByColumnAndRow(4, 17)->getValue();

$awayName = $objPHPExcel->getActiveSheet(0)->getCellByColumnAndRow(19, 17)->getValue();

echo "Output: $homeName - $awayName<br>";


//getCalculatedValue()
$homeName = $objPHPExcel->getActiveSheet(0)->getCellByColumnAndRow(4, 17)->getCalculatedValue();

$awayName = $objPHPExcel->getActiveSheet(0)->getCellByColumnAndRow(19, 17)->getCalculatedValue();

echo "Output: $homeName - $awayName<br>";


?>

</body>
</html> 
If anyone could get this to work, I'd be very grateful. Thanks!