I thought this excel chart example could be useful.
Note the use of Excel.application vs Excel.sheet.
<pre>
<?php
print "Hi";
$exapp = new COM("Excel.application") or Die ("Did not connect");
print "Application name:{$ex->Application->value}<BR>" ;
print "Loaded version: {$ex->Application->version}<BR>";
$wkb=$exapp->Workbooks->add();
print "we opened workbook<BR>";
$ex->Application->Visible = 1; print "we made excell visible<BR>";
$sheets = $wkb->Worksheets(1); print "selected a sheet<BR>";
$sheets->activate; print "activated sheet<BR>";
$sheets2 = $wkb->Worksheets->add(); print "added a new sheet<BR>";
$sheets2->activate; print "activated sheet<BR>";
$sheets2->name="Report Second page";
$sheets->name="Report First page";
print "We set a name to the sheet: $sheets->name<BR>";
$maxi=20;
for ($i=1;$i<$maxi;$i++) {
$cell = $sheets->Cells($i,5) ; $cell->activate; $cell->value = $i*$i; }
$ch = $sheets->chartobjects->add(50, 40, 400, 100); $chartje = $ch->chart; $chartje->activate; $chartje->ChartType=63;
$selected = $sheets->range("E1:E$maxi"); $chartje->setsourcedata($selected); print "set the data the chart uses <BR>";
$file_name="D:/apache/Apache/htdocs/alm/tmp/final14.xls";
if (file_exists($file_name)) {unlink($file_name);}
$wkb->SaveAs($file_name); print "saved<BR>";
$exapp->Quit();
unset($exapp);
?>
</pre>
Alex Madon