k suresh Nair
k suresh Nair

Reputation: 1

Call an user defined function in PHPExcel

I have an addin in excel which has many user defined function for calculating gas properties etc. I want to fetch the calculated value from a cell which has a formulae which is user defined. for eg I have a cell A2 which has a formulae "=Entrop(B2,C2)". I am loading the file using phpexcel and entering the posted values in Cells B2 and C2. I intend to get the value from A2. but getting an error as follows. PHPExcel_Calculation_Exception: Sheet1!A2 -> Formula Error: Unexpected , in C:\Program Files (x86)\Ampps\www\common\classes\PHPExcel\Cell.php on line 294

But the excel is working fine. I am getting the proper values in A2. Any help would be very much appreciated.

I have tried using

$entr=$objPHPExcel->getActiveSheet()->getCell('A2')->getFormattedValue(); // error

$entr=$objPHPExcel->getActiveSheet()->getCell('A2')->getCalculatedValue();// error

$entr=$objPHPExcel->getActiveSheet()->getCell('A2')->getValue(); //This gives the formulae.

Upvotes: 0

Views: 32

Answers (1)

Mark Baker
Mark Baker

Reputation: 212522

Not functionality that PHPExcel (or its successor PhpSpreadsheet) will ever support, unless somebody writes a VBA parser in PHP.

Upvotes: 1

Related Questions