Undefined offset: 1 in Excel5.php on line 4221 when loading spreadsheet with macros.

Topics: User Forum
Apr 20, 2010 at 4:22 PM

I am having problems trying to load and read a complex Excel 5 spreadsheet. This file is generated by an accounting software and it has some form fields and macros to send data to a server. I'm not sure if this might be the cause or perhaps PHPExcel has a limitation I have not heard of...

I am not trying to modify the macros or nothing weird... I just need to insert some data on a table and download the modified file, that's all.

I'm using Symfony PHP Framework and when trying to generate the file using Excel5 as reader, I get the following error:

 

( ! ) Notice: Undefined offset: 1 in /.../Excel5.php on line 4221
Call Stack
# Time Memory Function Location
1 0.0001 52336 {main}( ) ../backend_dev.php:0
2 0.3583 4665412 sfContext->dispatch( ) ../backend_dev.php:13
3 0.3583 4665412 sfFrontWebController->dispatch( ) ../sfContext.class.php:159
4 0.3584 4671032 sfController->forward( ) ../sfFrontWebController.class.php:48
5 0.3644 4848488 sfFilterChain->execute( ) ../sfController.class.php:245
6 0.3653 4862324 sfRenderingFilter->execute( ) ../sfFilterChain.class.php:53
7 0.3653 4862324 sfFilterChain->execute( ) ../sfRenderingFilter.class.php:33
8 0.3665 4868312 sfBasicSecurityFilter->execute( ) ../sfFilterChain.class.php:53
9 0.3781 5127188 sfFilterChain->execute( ) ../sfBasicSecurityFilter.class.php:62
10 0.3791 5129076 sfCommonFilter->execute( ) ../sfFilterChain.class.php:53
11 0.3791 5129076 sfFilterChain->execute( ) ../sfCommonFilter.class.php:29
12 0.3801 5132652 sfExecutionFilter->execute( ) ../sfFilterChain.class.php:53
13 0.3802 5132916 sfExecutionFilter->handleAction( ) ../sfExecutionFilter.class.php:42
14 0.3803 5132916 sfExecutionFilter->executeAction( ) ../sfExecutionFilter.class.php:76
15 0.4164 5388296 sfActions->execute( ) ../sfExecutionFilter.class.php:90
16 0.4176 5393912 expenseActions->executeListContpaqExport( ) ../sfActions.class.php:60
17 1.8576 19527020 PHPExcel_Reader_Excel5->load( ) ../actions.class.php:324
18 2.7440 23685496 PHPExcel_Reader_Excel5->_readDefinedName( ) ../Excel5.php:586
19 2.7442 23685496 PHPExcel_Reader_Excel5->_getFormulaFromStructure( ) ../Excel5.php:1792
20 2.7443 23685496 PHPExcel_Reader_Excel5->_getFormulaFromData( ) ../Excel5.php:3613
21 2.7443 23685496 PHPExcel_Reader_Excel5->_getNextToken( ) ../Excel5.php:3629

I hope someone can help understanding this issue and possible find a workaround or solution.

My dev environment is composed by:

PHPExcel Version: 1.7.0
PHP Version: PHP 5.2.6-2ubuntu4.6 with Suhosin-Patch 0.9.6.2
SO:

Kubuntu 8.10

Symfony Version:

1.2.8

Best regards and thanks in advance!

 

Coordinator
Apr 20, 2010 at 8:26 PM
Edited Apr 20, 2010 at 8:27 PM

It would be useful to have a copy of the file, if that's possible, in order to determine exactly what is causing this problem; although the most obvious cause would be a user-defined function used within the workbook.