Skip to Content
0
Former Member
Jun 10, 2008 at 09:02 AM

Run a macro with ABAP code

1222 Views

Hi everybody,

Could someone help me finding a way to run a macro of an excel sheet with an ABAP program.

Explanation:

- I launch an abap program that opened an excel sheet with that kind of code

-


include ole2incl.

DATA : w_excel type ole2_object,

w_books type ole2_object,

w_book type ole2_object,

w_sheets type ole2_object,

w_sheet type ole2_object,

w_cell type ole2_object,

w_rows type ole2_object,

w_font type ole2_object.

create object w_excel 'Excel.Application'.

CALL METHOD OF W_EXCEL 'WORKBOOKS' = W_BOOKS.

...

...

CALL METHOD OF W_SHEET 'CELLS' = W_CELL

exporting #1 = row

#2 = column.

....

....

CALL METHOD OF W_SHEET 'SAVEAS'.

....

....

-


With my ABAP program:

- i can open my excel template.

- i can write and format data inside my excel sheet.

- i can close and save my excel sheet.

but i don't how to run the macro that exists in my excel template.

Thank you in advance.