‎2016 Feb 12 9:17 AM
HI Experts,
i am using ole concept to download excel with multiple tabs(dynamic).
after the file is downloaded it is not having no of sheets specified.
i using below code
SET PROPERTY OF gv_excel 'SheetsInNewWorkbook' = lv_line.
can anyone help...?
thanks.
‎2016 Feb 12 11:46 AM
For each new sheet that you require you should be using the method Sheets.Add on an OLE object that is a workbook.
To find out how to do things use the macro recorder in Excel and then translate the VBA to ABAP.
Regards
Rich
‎2016 Feb 13 10:03 AM
‎2016 Feb 15 8:36 AM
‎2016 Mar 04 8:57 AM
thanks for your suggestion.
i am using below code .
CREATE OBJECT gv_excel 'EXCEL.APPLICATION'.
SET PROPERTY OF gv_excel 'VISIBLE' = 0.
CALL METHOD OF
gv_excel
'WORKBOOKS' = gv_workbook.
CALL METHOD OF
gv_workbook
'ADD'.
SET PROPERTY OF gv_excel 'SheetsInNewWorkbook' = lv_line_tmp.
sometimes i am getting number of sheets mentioned and sometimes i am getting only 2/3 sheets.
thanks for your help
‎2016 Mar 04 9:18 AM
Hi
The problem with OLE and excel is that when you use the 'QUIT' statement it does not actually quit Excel and you end up with hundreds of invisible excel instances running. It may be that you have a problem with that when you are getting the 2/3 sheets only. When this happens check in your task manager to see if that is the case.
Rich
‎2016 Mar 04 9:27 AM
thanks for your response.
so when we run the program which creates excel all the excel instances in background should be closed..?
thanks,
Phanindra
‎2016 Mar 04 9:42 AM
No,
I'm just pointing out that if you have been testing this all day you could have hundreds of instances running which could affect things. I'm trying to remember how I killed them off... let me think about that.
‎2016 Mar 17 12:26 PM
hello,
thanks for your help,
i am still facing this issue.
do you remember how to kill excel instance, for proper file creation.
thanks again...:)
Regards,
Phanindra G
‎2016 Mar 17 1:48 PM
Can't remember off of the top of my head, you call the QUIT method. Search the web - there's loads of stuff out there about this.
Rich