Exception error when importing formulas.

Topics: Developer Forum, Project Management Forum
Feb 18, 2011 at 1:39 PM

Firstly, I need to say thanks for this tool, it has been a tremendous help so far in my work, thank you so much. However, I've run into an issue I can't seem resolve and was wondering if it's a known bug or whether it's simply not possible to do.

I'm running version 1.7.5 on PHP 5.3.1 (on XAMPP for Windows (7) in a devlopment environment). Most features of PHPExcel work flawlessly and am confident that the confirguation is fine.

I'm trying to import a large spreadsheet from my client to extract just a few columns from a single sheet. The contents of this sheet are dragged in from loads of other sheets which in turn sometimes come from another sheet themselves. It's a convoluted file but it's my client's format and I'm not in a position to change it.

The fatal error reads:
Fatal error: Uncaught exception 'Exception' with message 'PUBLISHED FARES!L3 -> All Fares!AF5 -> All Fares!T5 -> All Fares!S5 -> Formula Error: Unexpected ,' in Y:\Documents\Projects\Echelon\trunk\inc\classes\PHPExcel\PHPExcel\Cell.php:284 Stack trace: #0 Y:\Documents\Projects\Echelon\trunk\htdocs\ext\costing\files\import.inc.php(79): PHPExcel_Cell->getCalculatedValue() #1 Y:\Documents\Projects\Echelon\trunk\htdocs\ext\costing\import.php(21): import_step_1(Array) #2 Y:\Documents\Projects\Echelon\trunk\htdocs\costing.php(29): include_once('Y:\Documents\Pr...') #3 {main} thrown in Y:\Documents\Projects\Echelon\trunk\inc\classes\PHPExcel\PHPExcel\Cell.php on line 284

The Published Fares sheet is the sheet I am interested in and the S5 cell from the 'All Fares' sheet contains the following formula:

=J5*VLOOKUP(P5,Currencies!$A$1:$B$29,2,FALSE)
I think it's this formula which is throwing the exception but yet it works fine in Excel (both Excel 5 and 2007).

I can't post the Excel file publically but am willing to send it to the (wonderful) developers of PHPExcel if it would help. Any help offered will be very much apprecaited, I'm working on a workaround in the meantime and will be able to get it to work but it would be nice if I could just use this one sheet.


Thanks very much.

Coordinator
Feb 18, 2011 at 3:24 PM

Please try with the latest code from the SVN repository. There have been a number of issues raised when formulae reference cells in other worksheets, and these are now largely resolved.

Feb 18, 2011 at 3:28 PM

Thanks Mark,

I'll give it a try now and let you know how it goes in the next hour or two. Thanks for the very quick response. Excellent.

Feb 18, 2011 at 4:07 PM

Thanks Mark, it works like a charm.

Thanks very much for your assistance.