Fatal error, saving file

Apr 27, 2010 at 8:51 PM

Hi everyone,

when I want to save a excel 2007 file, I have this error.

I have already saved many files before, but this one is big and has drawing within.

Fatal error: Call to a member function cellExists() on a non-object in C:\Program Files\wamp\www\Classes\PHPExcel\Calculation.php on line 2740

What does it mean ? 


Coordinator
Apr 27, 2010 at 9:50 PM
Edited Apr 27, 2010 at 10:58 PM

I assume you're using the 1.7.2 release.

The error your getting has nothing to do with the drawing, but suggests an error in a formula within the workbook... a cell reference to a cell within another worksheet that can't be accessed for some reason. Do any of your worksheets have names that contain non-ASCII characters?

To help diagnose this problem, you might try enabling logging for the calculation engine using

PHPExcel_Calculation::getInstance()->writeDebugLog = true; 

Then trapping the error and using

var_dump(PHPExcel_Calculation::getInstance()->debugLog);

 to display the log. The last entry in that log may give a clue.

Apr 28, 2010 at 7:07 PM
Edited Apr 28, 2010 at 7:14 PM

Thank you for your answer,

I will try to locate the error as you say.

By the way, do you know where I can find a full documentation about all the functions of PHPExcel ?

I have already read the word document, do you have others ?

Thank you again

 

Apr 28, 2010 at 9:08 PM

Hi,

I found the error but now when I save the document, I lose the drawings, I have new sheets and the server crash at the end lol.

Any ideas what's going on ?

thx

 

Coordinator
Apr 28, 2010 at 9:17 PM
vanatis wrote:

By the way, do you know where I can find a full documentation about all the functions of PHPExcel ?
I have already read the word document, do you have others ?

 There's full phpdocs documentation if you access /Documentation/API/index.html

vanatis wrote:

I found the error but now when I save the document, I lose the drawings, I have new sheets and the server crash at the end

Not without a bit more information, such as a code sample that demonstrates the problem

Apr 29, 2010 at 10:33 AM

Sorry MarkBaker but the link :

http://phpexcel.codeplex.com/Documentation/API/index.html

do not exist anymore.

I find out why the server cash but I sill lose the drawings and have some new sheets.

The main idee is :

I have a external excel file coming from excel 2007.

I like to modify it with php and save it again in excel format.

 

 I have tried with simple excel document and it works. But with a excel file with drawings within, I have the problems I told you.

This is the code I use (its the example code) :

include 'PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$excelFileName = '100101.xlsx';

$objPHPExcel = $objReader->load($excelFileName);

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');
$objWriter->save("100101_test.xlsx");

Sorry to waste your time

Coordinator
Apr 29, 2010 at 10:43 AM
vanatis wrote:

Sorry MarkBaker but the link :

http://phpexcel.codeplex.com/Documentation/API/index.html

do not exist anymore. 

That's because it never existed here on the site. Unless you retrieved the latest SVN code, or one of the nightly builds, it's part of the production release included in the files that you downloaded.

 

vanatis wrote:

 I have tried with simple excel document and it works. But with a excel file with drawings within, I have the problems I told you.

Nothing obviously wrong with your code, so it must be something in the workbook that you're loading which is causing the problem. Is it possible for you to upload that file (assuming you can strip out anything personal and it still exhibits the problem)?

Apr 29, 2010 at 8:01 PM
Edited Apr 29, 2010 at 8:02 PM

Hi,

I dont know why I didn't unzip the documentation. I am sorry, I feel so stupid.

I don't think that my problem comes from the file itself. I have tried with a simple file with simple inserted shapes and its still not working.

I think I should use some classes like :

PHPExcel_Writer_Excel2007_Drawing

with methods : allDrawings, writeDrawings, etc.

something like that, no ? (I read quickly the documentation lol)

Can you show me how ? If you have the time of course.

thx