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 OLE - Excel file saving to the desktop error occuring

Former Member
0 Kudos

Hello,

I am saving my excel sheet workbook created by OLE on to my local machine.

it is downloading properly but the issue is it is generating one temp file simultaneously,

Example : if my file name is Test it is generating test and '~$test" file.

i am not able to close the file ...it is saying that "excel sheet is editing by other program"

Help me out ...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try if you can delete that temp file using method FILE_DELETE of class CL_GUI_FRONTEND_SERVICES before closing your original one.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Try if you can delete that temp file using method FILE_DELETE of class CL_GUI_FRONTEND_SERVICES before closing your original one.

Former Member
0 Kudos

Hello,

I have got the solution..

using following syntax

CALL METHOD OF h_excel 'QUIT'.

h_excel is the object i have created for excel application

Pawan_Kesari
Active Contributor
0 Kudos

hope you are following steps to close the file and excel...

below code is just for reference...

1. Save the file

CALL METHOD OF h_work_book 'SaveAs' EXPORTING #1 = i_filename .

2. Close the excel window

GET PROPERTY OF h_excel_application 'ActiveWindow'  = h_activewindow .
CALL METHOD OF h_activewindow 'Close' .

3. Free all the OLE object you have

FREE OBJECT : h_excel_application ,
                  h_activewindow      ,
                  h_work_books        ,
                  h_work_book         ,
                  h_active_cell       .

4. Call FM FLUSH in the end

CALL FUNCTION 'FLUSH'.