Application Development 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: 

Create Macros in Excel using Abap

Former Member
0 Kudos

I have a requirement where I have to download the alv output to excel sheet (Simple table with multiple rows), However after I download the file I have to run the macro. Macro is not readily available. I have to create it from my abap program placing the scripts within the macro in my abap program. I searched various links and most of them provide information about running an existing macro. But in my case I need to create it in abap and then run it in downloaded excel file.

I am inserting a snapshot of my code of how I am filling the table entries. Any help would be greatly appreciated.

I have tried add_script from_table method but to no avail.

5 REPLIES 5

0 Kudos

Hi Anup.

Were you able to solve your problem?

If so, how did you do it? I have a similar requirement.

Regards,

Sreejith.

0 Kudos

Hi,

I don't have this requirement but I am curious to know more about it,

Regards

0 Kudos

It has been a while and hence I do not remember the exact answer. However I was unable to come up with a solution since the macros itself within excel was quite complex. Hence came up with a workaround. I requested them to save an empty excel file with the required macros in the shared location. I always used to open that file and use a copy of it to save to the local client. Even if they had to change the macros in future, they can just change it the existing excel file present in the shared drive. 

Regards,

Anup

0 Kudos

Thank you Anup for the response.

Regards,

Sreejith.

0 Kudos

Hi Experts,

I have the following requirements

1.  Place 2 Buttons Insert / Delete Rows in the excel file which will be generated by ABAP program          using OLE. On pressing the buttons the corresponding on action macros will be executed.

2. Paste special option which will copy one row and format the rest of the rows.

Since the entire excel will be generated through the abap program is there a way to achieve the above requirements. I have tried to place button and do paste special which dint work.

I could't find any resource to refer for creating macro. All the forums here refers to existing macros in excel.

Since this is an urgent requirement, I request experts to through some light on this if any one has worked on this requirements.

Regards

Ravi