Skip to Content
0
Former Member
Mar 07, 2006 at 10:41 AM

Problem instruction Quit of Excel

17 Views

Hello,

I have a program that generates a excel document, but when I use the ‘Quit’ instruction for to exit of application I have a problem: when the program execute the form ‘log’ the application Excel continue open. Only application Excel quit when press the back button of the program.

The program code is this:

START-OF-SELECTION.

CREATE OBJECT gs_excel 'EXCEL.Application'.

CALL METHOD OF gs_excel 'Workbooks' = gs_workbook.

CALL METHOD OF gs_workbook 'Add'.

CALL METHOD OF gs_excel 'Worksheets' = gs_sheet

EXPORTING #1 = 1.

CALL METHOD OF gs_sheet 'Activate'.

CALL METHOD OF gs_sheet 'SaveAs'

EXPORTING #1 = l_direct

#2 = 1.

CALL METHOD OF gs_workbook 'Close' .

CALL METHOD OF gs_excel 'Quit'.

FREE OBJECT gs_sheet.

FREE OBJECT gs_workbook.

FREE OBJECT gs_excel.

END-OF-SELECTION.

PERFORM log.

FORM log.

LOOP AT i_log.

WRITE: / i_log-error.

ENDLOOP.

ENDFORM. " log