There is either 1) an "undocumented" bug with Excel, or there's
a bug with PHP's handling of COM objects.  Becuase i've tried
virtually every permutation of Quit() and Release() (and even
some bogus calls like Exit() just for fun) and absolutely
*nothing* closes the Instance.

My other gripe is that documentation for COM+PHP+Excel is
*extremely* sparse...  I'm going to write up an article and
post some sample code when i'm done with this project.

This URL helped me make sense of the Excel COM interface:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/htm
l/deovrMicrosoftExcel2000.asp


---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: Neil Lincoln [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 7:17 PM
> To: Scott Hurring; Php-Win (E-mail)
> Subject: RE: [PHP-WIN] Excel not closing after using it via COM
> 
> 
> I spent many hours on this and gave up and added a process 
> kill for the
> EXCEL "zombie" after exiting the COM code.
> There must be a better way..
> 
> -----Original Message-----
> From: Scott Hurring [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 4:40 PM
> To: Php-Win (E-mail)
> Subject: [PHP-WIN] Excel not closing after using it via COM
> 
> After working with Excel via COM, i cannot seem to get
> the instance of Excel to quit (CTL+ALT+DEL shows an
> 'EXCEL.EXE' in my process list).  The script opens up
> a file, puts some numbers in, adds some numbers up, then
> closes the sheet and tells excel to exit.  I've been
> trying for a few hours now to get Excel to actually
> *quit* when i call $excel->Quit(); unset($excel);
> 
> I have made sure to save the book ($book->Save()),
> have set DisplayAlerts="FALSE" (which, on the MS
> website, says that Excel will force excel to exit
> even if there are unsaved changes).
> 
> I've been trying various ways of calling Quit,
> Release and unset($excel)... all of them failing
> miserably to get excel to quit (I even adapted
> sample VB script to loop through all open books
> and save them... to be doubly-sure that all changes
> are saved).
> 
> For example, the following code always fails and
> leaves an excel instance in memory.
> 
>   if (!$excel->Quit())
>         die("Cannot call excel->quit");
> 
> Can enyone help me out here?  Can anyone tell me how
> to get at any errors that Excel might be returning
> (so i can figure out *why* it won't go away)
> 
> I'm using Win2k, Office 2k, PHP 4.2.0.
> 
> Thanks in advance.
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to