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: 

inserting macro using OLE in excel

former_member206153
Participant
0 Kudos
806

Hi All,

I am downloading an excel through my abap program using GUI_DOWNLOAD.

My requirement is to open/read that excel and apply macro to it, so that it comes out formatted in the end.

Earlier, i used OLE methods to format the excel . But due to large amount of data, it takes lot of time to format every cell of the excel.

Can anyone please let me know how i can apply macros to my excel , using OLE or any other method.

i read somewhere that you need to insert the macro file using OLE into the excel spreadsheet first, but i m not sure how that needs to be applied.

I am really new to OLE methods.

Thanks in Advance

Bhavika

5 REPLIES 5

matt
Active Contributor
0 Kudos
322

If you only want to format the output of the spreadsheet, forget macros: use abap2xlsx  http://scn.sap.com/community/abap/blog/2010/07/12/abap2xlsx--generate-your-professional-excel-spread...

This has the added advantage of working in background as well.

matt

0 Kudos
322

Hi Mathew,

Can you provide me some sample code for formattig excel using abapxlsx.

Thanks in advance

Bhavika

matt
Active Contributor
0 Kudos
322

Google for it and you'll find plenty of examples.

former_member206153
Participant
0 Kudos
322

Hi Mathew, i will try the suggestion you have provided.

can others provide me any other alternate solution / or how to use macros in OLE.

Thanks

Bhavika

sreehari_vpillai
Active Contributor
0 Kudos
322

Hi Bhavika,

Was it an April fool

We can use OLE only if the file that you are trying to acess is found at client machine. Through GUI download, first you have to make the physical file avaialble at a specific location. Then you can start the OLE functioning.