ID: 21489
Comment by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: COM related
Operating System: Win 2K Server
PHP Version: 4.3.0
New Comment:
I see this behaviour on 4.2.3 but not with 4.3.0 on Win2Kpro SP3 Apache
1.3.27 (PHP running as module).
On 4.2.3 the same Excel.exe is reused each time I run a
script very similar to this one. I end up with one Excel.exe left in
taskmanager after running this script "1 to n" times.
In 4.3.0 Excel.exe appears for a moment while the script runs then
disappears.
I get exactly the same behaviour on Win2k server SP2.
Previous Comments:
------------------------------------------------------------------------
[2003-01-07 07:52:30] [EMAIL PROTECTED]
This is the code I always used with PHP prior to 4.2.X and 4.3.0:
function ExcelSheet($filein,$tmpdir) {
$fileout = substr(tempnam($tmpdir, "tmp"), 0, -4);
$ex = new COM("Excel.sheet") or Die ("Cannot find excel!");
$ex->Application->Visible = 0;
$wkb = $ex->Application->Workbooks->Open($filein) or Die ("Cannot
open excel!");
$ex->Application->ActiveWorkbook->SaveAs($fileout, -4143);
$ex->application->ActiveWorkbook->Close("False");
unset($ex);
return($fileout . ".xls");
}
The excel function works, but afterwards the excel process remains in
memory, as other people have already argued.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21489&edit=1