Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Excel OLE

Former Member
0 Kudos

I'm creating an Excel worksheet with OLE and Excel Macros and the file is created without any problems. The only issue I have is that when you close Excel, the process in Windows keeps running (CtrlShiftEscape to view the process EXCEL.EXE). Is this a known issue with Office 2003 or a problem in SAP4.6C with the OLE2 connection not closing properly.

TIA

1 ACCEPTED SOLUTION

Former Member
0 Kudos

first call quit application then free object

CALL METHOD OF gv_excel 'QUIT'.

FREE OBJECT gv_cell.

FREE OBJECT gv_excel.

FREE OBJECT gv_books.

FREE OBJECT gv_sheet.

take a look on FM ALSM_EXCEL_TO_INTERNAL_TABLE lines (112) just before the end of the function, to see how sap deal with this problem.

4 REPLIES 4

Former Member
0 Kudos

first call quit application then free object

CALL METHOD OF gv_excel 'QUIT'.

FREE OBJECT gv_cell.

FREE OBJECT gv_excel.

FREE OBJECT gv_books.

FREE OBJECT gv_sheet.

take a look on FM ALSM_EXCEL_TO_INTERNAL_TABLE lines (112) just before the end of the function, to see how sap deal with this problem.

0 Kudos

Thanks for the fast reply Joseph, but unfortunetly, I don't want to close Excel automatically. The user must be able to visualize the file. I still tried the 'QUIT' method and the FREE OBJECT (which I already had) and it didn't work because the FREE OBJECT cell, workbook and range return errors. Any idea as to why they return errors (even if I QUIT excel).

0 Kudos

NM. I found the problem (I changed the code and was freeing objects that weren't used, so they weren't instanciated). Now it works fine. Thanks Joseph.

0 Kudos

I was about the response you to check your code

(Le plaisir etait pour moi)