Search code examples
excelabapole

Passing data via OLE to existing Excel file - ABAP


I'm trying to export several tables to an Excel file using OLE.

Right now, I'm developing the hole file (merging cells, borders, shades, places, etc..).

But I already have an empty file. Is it possible to use OLE to pass the data to the right places of an existing excel file?

Thank you.


Solution

  • I've found the answer. Needed to use this:

    * Start the application
      create object e_appl 'EXCEL.APPLICATION'.
      set property of e_appl 'VISIBLE' = 1.
    
    * Open the file
      call method of e_appl 'WORKBOOKS' = e_work.
    
      call method of e_work 'OPEN'
              exporting
                   #1 = p_file.
    

    Thank you.