Consultor Eletrônico



Kbase P16921: Working with Microsoft Excel via ActiveX Automation
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/20/2008
Status: Verified

FACT(s) (Environment):

Windows
Progress 8.x
Progress 9.x
OpenEdge 10.x

SYMPTOM(s):

Working with Microsoft Excel via ActiveX Automation

Microsoft Excel does not terminate when the application is finished using it

CAUSE:

Before releasing the Excel object, the QUIT method must be used. Otherwise the process will not deleted from memory.

FIX:

The following code will correctly handle the closing of a Microsoft Excel control:

DEFINE VARIABLE excelAppl AS COM-HANDLE NO-UNDO.

CREATE "Excel.Application" excelAppl.

PAUSE.

excelAppl:QUIT(). /* Use This For Excel 97 */
excelAppl:QUIT(0). /* The '0' Is Needed For Other Excel Versions */

RELEASE OBJECT excelAppl.