Formulas with sheet references

Oct 8, 2007 at 2:58 PM
I have some troubles in the creation of formulas with sheet references. It give me this error Uncaught exception 'Exception' with message 'Unknown sheet name equalizationvasca1 but the sheet _ equalizationvasca1_ has been already created.
Thanks
Coordinator
Oct 9, 2007 at 12:58 PM
PHPExcel doesn ot support sheet references...
Oct 9, 2007 at 4:52 PM
And another question: why i'm not able to set a cell datatype as string, i think i've done the correct operation but nothing. (I want set the datatype to string before, because i will insert value as 00123)
Oct 9, 2007 at 4:52 PM
so no possibility to do this
Oct 10, 2007 at 9:07 AM


maartenba wrote:
PHPExcel doesn ot support sheet references...

maarten, I'm surprised ;)) Of course it supports sheet references, I use them extensively. It also supports references to other documents in formulas! bertorial, what is exactly your problem? Show us a compact example of code...
Coordinator
Oct 10, 2007 at 10:45 AM
No surprise needed :-)
- PHPExcel_IWriter implementations DO support sheet references
- PHPExcel formula calculation in PHP does NOT

So if you want to let PHPExcel calculate a sheet reference formula, it will say "no can do!". If you write a sheet reference to Excel2007, that should work fine.
Oct 11, 2007 at 1:01 PM

francescom wrote:


maartenba wrote:
PHPExcel doesn ot support sheet references...

maarten, I'm surprised ;)) Of course it supports sheet references, I use them extensively. It also supports references to other documents in formulas! bertorial, what is exactly your problem? Show us a compact example of code...



//first at all i create with a loop all my sheets
for($j=0;$j<$project->getApplication($i1)->tanksNum();$j+){
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($j+1);
$mySheetName=strtolower($project->getApplication($i1)->getValue('applicazione'))."tank".($j1);
$objPHPExcel->getActiveSheet()->setTitle($mySheetName);
}

//and then i created the formula
$objPHPExcel->getActiveSheet()->setCellValue('B'.($i1), '=applicationTank1!A2applicationTank2!A2');

but it gives me an error:
<b>Fatal error</b>: Uncaught exception 'Exception' with message 'Unknown sheet name applicationvasca1

in formula' in /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php:776

Stack trace:

#0 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php(721): PHPExcelWriterExcel5_Parser-

>_packExtRef('applicationvasc...')

#1 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php(479): PHPExcelWriterExcel5_Parser-

>_convertRef3d('applicationvasc...')

#2 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php(1510): PHPExcelWriterExcel5_Parser-

>_convert('applicationvasc...')

#3 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php(1481): PHPExcelWriterExcel5_Parser-

>toReversePolish(Array)

#4 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Worksheet.php(1767): PHPExcelWriterExcel5_Parser-

>toReversePolish()

#5 /Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Worksheet.php(1156): PHPExcelWriterExcel5_Worksheet-

>writeFormul in <b>/Library/WebServer/Documents/estimate/PHPExcel/Writer/Excel5/Parser.php</b> on

line <b>776</b><br />

i don'want calculation in PHP, i want only print the formula and the excel calculate it
tanks to all
Coordinator
Oct 11, 2007 at 9:40 PM
Am I corrct if you add sheet applicazione, and afterwards applicationTank?
If so, I know why this is going wrong and will create a work item for that.
Coordinator
Oct 11, 2007 at 9:53 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.