php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21489 Excel hangs after creation via COM
Submitted: 2003-01-07 07:52 UTC Modified: 2003-01-25 11:57 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: achirizzi at softeam-tsa dot it Assigned:
Status: Closed Package: COM related
PHP Version: 4.3.0 OS: Win 2K Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: achirizzi at softeam-tsa dot it
New email:
PHP Version: OS:

 

 [2003-01-07 07:52 UTC] achirizzi at softeam-tsa dot it
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-08 21:17 UTC] php_general at e1da dot net
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.
 [2003-01-10 04:46 UTC] achirizzi at softeam-tsa dot it
I solved the problem changing the default printer on the server! It seems strange (and it is not) but if I change the printer and put a simple (native and not plugged to the server...) printer as the default printer, rather than a hand-installed one, EXCEL seems to act in the right way. (the printer in question is a Canon Laser SHOT LBP-1210)
EXCEL does not show any strange behavior if it run normally by opening it via the menu. But if it is run via PHP and COM the thing happens
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC