ID: 21480
Comment by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: COM related
Operating System: Windows 2000 Pro
PHP Version: 4.3.0
New Comment:
It's a simple Excel application.
Apache.exe - Application Error says, "The memory could not be
'written'."
<?
function do_Excel ($results, $UserDir)
{
$excel = new COM("Excel.Application");
$excel->sheetsinnewworkbook=1;
$excel->Workbooks->Add();
$book=$excel->Workbooks(1);
$sheet=$book->Worksheets(1);
$sheet->Name="Sheet1";
$sheet->activate;
$cell=$sheet->range("A2");
$cell->activate;
$cell->value="Generic";
// putVariable($sheet, "B", "Dchains", 48);
putVariable($sheet, "B", "Dchains", $results['partwidth']);
// putVariable($sheet, "C", "HtSlats", 36);
putVariable($sheet, "C", "HtSlats", $results['partheight']);
putVariable($sheet, "D", "SlatThickness", 0.25);
putVariable($sheet, "E", "HeadShaftCC5PD", 15.679);
putVariable($sheet, "F", "HeadShaftDiameter", 1.9375);
putVariable($sheet, "G", "HeadShaftLength",
"DS1+DS2+Dchains+DS3+DS4+2");
putVariable($sheet, "H", "DS1", 1.75);
putVariable($sheet, "I", "DS2", 3.75);
putVariable($sheet, "J", "DS3", 3.75);
putVariable($sheet, "K", "DS4", 5.1875);
putVariable($sheet, "L", "DS5", 3);
putVariable($sheet, "M", "TS1", 1.75);
putVariable($sheet, "N", "TS2", 3.75);
putVariable($sheet, "O", "TS3", 3.75);
putVariable($sheet, "P", "TS4", 1.75);
putVariable($sheet, "Q", "SplitTailShaft", 0);
putVariable($sheet, "R", "TailShaftCC5PD", 15.679);
// putVariable($sheet, "S", "DLength", 216);
putVariable($sheet, "S", "DLength", $results['partlength']);
putVariable($sheet, "T", "TailShaftDiameter", 1.4375);
putVariable($sheet, "U", "HeadShaftKey", 0.5);
putVariable($sheet, "V", "TailShaftKey", 0.375);
putVariable($sheet, "W", "TailShaftLength",
"TS1+TS2+TS3+TS4+Dchains");
$book->saveas($UserDir.'/GlobalVariables.xls');
echo_gray ( '<br>Saved as '.$UserDir.'/GlobalVariables.xls');
$book->Close(false);
unset($sheet);
unset($book);
$excel->Workbooks->Close();
$excel->Quit();
unset($excel);
}
function putVariable ($sheet,$this_cell,$value,$value2)
{
$cell=$sheet->range($this_cell.'1');
$cell->activate;
$cell->value=$value;
$cell=$sheet->range($this_cell.'2');
$cell->activate;
$cell->value=$value2;
}
?>
Previous Comments:
------------------------------------------------------------------------
[2003-01-07 05:41:53] [EMAIL PROTECTED]
Can you include the script so we can try to reproduce the problem? If
you can't include the whole script just include the part where it
hangs...
(+ changing summary/category).
Thank you for your report.
------------------------------------------------------------------------
[2003-01-07 01:34:19] [EMAIL PROTECTED]
A working script written using COM now crashes Apache 1.3.26 after
upgrading to PHP 4.3.0.
It also hangs Apache 1.3.27.
Excel zombies wander.
I was using a snap dated sometime later than 10/17/2002. And according
to CVS no changes have been made to the COM extension since then other
than bumping of the copyright year.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21480&edit=1