2016 Jun 16 8:26 AM
Dear all,
I am using OLE in ABAP Code to download excel file through my ABAP Code as below:
CREATE OBJECT W_EXCEL 'EXCEL.APPLICATION'. "CREATE OBJECT FOR EXCEL
SET PROPERTY OF W_EXCEL 'VISIBLE' = 1. "IN BACKGROUND MODE
CALL METHOD OF W_EXCEL 'WORKBOOKS' = W_WORKBOOK.
CALL METHOD OF W_WORKBOOK 'ADD'. "CREATE A NEW WORKBOOK
SET PROPERTY OF W_EXCEL 'SHEETSINNEWWORKBOOK' = 1. "NO OF SHEETS
SET PROPERTY OF W_EXCEL 'DisplayAlerts' = 0.
CALL METHOD OF W_EXCEL 'WORKSHEETS' = sheet
EXPORTING
#1 = 1.
CALL METHOD OF w_excel 'ActiveWorkbook' = W_WORKSHEET.
and so on..
I want the below macro code to run while downloading,
Private Sub Workbook_Open()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
End Sub
Please guide how to incorporate/convert the same in OLE ABAP Code.
Thanks
Chehak
2016 Jun 16 9:56 AM
Hi,
Have you tried with this?
CALL METHOD OF W_EXCEL 'ExecuteExcel4Macro'
EXPORTING #1 = '"SHOW.TOOLBAR(""Ribbon"",False)"'.
or this?
CALL METHOD OF W_EXCEL 'SendKeys'
EXPORTING #1 = '^{F1}'.
Regards,
Ricardo.
2016 Jun 16 10:32 AM
CALL METHOD OF W_EXCEL 'ExecuteExcel4Macro'
EXPORTING #1 = '"SHOW.TOOLBAR(""Ribbon"",False)"'.
The above code works to disable the button across the menubars but the 'Office Button' is still open for usage. When i apply the macro in excel. I get the below view of excel.
But while using the code specified in ABAP, the following output in excel is achieved. I need to get the above functionality. Hope you can help.