Application Development and Automation 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: 
Read only

Execute macro in a program

Former Member
0 Likes
501

How to execute a macro of excel from a report?

1 REPLY 1
Read only

Former Member
0 Likes
379

using the FM SAP_CONVERT_TO_XLS_FORMAT.

to run the macro:

CREATE OBJECT h_excel 'EXCEL.APPLICATION'.

call method of h_excel 'WORKBOOKS' = h_mapl.

set property of h_excel 'VISIBLE' = 0.

call method of h_mapl 'OPEN'

EXPORTING

#1 = d_file.

CALL METHOD OF H_EXCEL 'ActiveWorkbook' = h_book .

CALL METHOD OF H_book 'Activesheet' = H_sheet .

CALL METHOD OF h_excel 'RUN'

EXPORTING

#1 = ld_macro.