For help!Why this has errors about excel???
Posted: Thu Jun 05, 2003 4:47 am
the code is :
Code: Select all
$exapp = new COM("Excel.application");
$exapp->SheetsInNewWorkbook = 1;
$exapp->Application->Visible = 1;
$exapp->DisplayAlerts = True;
$wkb=$exapp->Workbooks->add();
$sheets = $wkb->Worksheets(1);
$sheets->activate;
$sheets->name = "hello";
for ($i=0; $i < 100; $i++)
{
for ($j=0; $j < 10; $j++)
{
$a = chr(65 + $j);
$ran = $sheets->Range($a.$i);
$ran->value = $i;
}
}
$exapp->Quit();Code: Select all
tags[/size]
and the errores are:
1.can't written in memory address,the address XXXXXXXXX is read ,can't be write.but i succes make a new excel file.
2.this code: header("Location:",$file_name);it doesn't work.
P.S:My enviorment:
Windows 2000 Professional,Apache 2.0.45,PHP 4.0.13
Thanks a lot.