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 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 Previous Comments: ------------------------------------------------------------------------ [2003-01-08 21:17:35] [EMAIL PROTECTED] 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-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