Page 1 of 1

PHP & COM

Posted: Fri Aug 23, 2002 9:38 am
by edoardor
I have e code like this:

Code: Select all

$workbook = "c:\\test.xls";
    $ex = new COM("Excel.application") or Die ("Did not connect");
    $ex->application->Workbooks->Open($workbook) or Die ("Did not open");
    $ex->Application->ActiveWorkbook->RefreshAll(); // this refresh tables
    $ex->Application->ActiveWorkbook->PrintOut();
    $ex->application->ActiveWorkbook->Close(false);    
    $ex->Quit();
    $ex->Release();
    $ex = null;
every time that I launch this program remains opened a process in taskmanager. if launch 20 times I find 20 EXCEL running

Someone knows what can seems in order to obviate to this problem or to say me where I mistake?

thanks

Posted: Fri Aug 23, 2002 12:35 pm
by volka
I'm not sure but maybe:
If unsaved workbooks are open when you use this method, Microsoft Excel displays a dialog box asking whether you want to save the changes. You can prevent this by saving all workbooks before using the Quit method or by setting the DisplayAlerts property to False. When this property is False, Microsoft Excel doesn’t display the dialog box when you quit with unsaved workbooks; it quits without saving them.

Code: Select all

$ex->Application->DisplayAlerts = False;
and
expression.Quit
expression Required. An expression that returns an Application object.

Code: Select all

$ex->Application->Quit();

Posted: Sat Aug 24, 2002 4:01 am
by edoardor
Hi,
thanks for the information that you have given to me, I have made the modifications but it does not change null.

I have found this bug report in PHP , therefore it does not remain that to wait for version 4.3

Good job and thanks