‎2013 Sep 08 12:21 PM
Hi,
I've used OLE to export data from SAP to Excel, so I have the document, and at last I'd like to execute a Excel macro from ABAP inside this new Excel that I've just created, is it possible? Where should I store the Excel macro?.
I've read about I_OI_DOCUMENT_PROXY interface, but I can't execute the macro yet.
Please, if somebody knows how to do it, it would be great.
Thanks.
‎2013 Sep 09 12:32 PM
Hi Mario,
CREATE OBJECT go_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF go_excel 'Visible' = 1 .
GET PROPERTY OF go_excel 'Workbooks' = gs_wbooks .
GET PROPERTY OF go_wbooks 'Application' = go_app .
CALL METHOD OF go_app 'Run'
EXPORTING #1 = macro_string .
Regards
‎2013 Sep 10 8:31 PM
Hi Mohammed,
I've tried, but I don't know where store the Excel macro to be executed from SAP (C:\Windows\System32??), and which name and extension. I'd need some real example.
‎2013 Sep 12 6:48 AM
Hi Mario,
The Macros you want to execute are and should be part of global excel template.
It is not in any system32 folder.....
To execute anything you need to connect to it... so
You need to create and EXCEL OLE Object.
Open the WorkBook and then Execute the Macro.
the macro_string is the name of the Macro you want to execute.
Regards
‎2013 Sep 12 7:10 AM
Hi Mario,
I have never executed an Excel Macro.
But found this sample report SAPRDEMOEXCELINTEGRATION.
It calls MACRO 'R3StartupMacro' at line number 288.
In OAOR & SBDSV1 Transaction codes, you will need to give
CLASS NAME = SOFFICEINTEGRATION and CLASS TYPE = OT to see associated details.
Regards,
Nisha Vengal.
‎2013 Sep 12 7:43 AM
Hi Mario,
Check reply by Lars on thread http://scn.sap.com/thread/148656
Check original post by Rebecca on thread http://scn.sap.com/thread/26946
DATA: macro_string(50) TYPE c VALUE 'FB03process.FromTheBeginning'
Short MACRO as "EXCELNAME.FromTheBeginning" is directly written in EXECUTE_MACRO method.
Regards,
Nisha Vengal.