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: 

How to delete sheet1, sheet2, sheet3 with ole2_object in excel

Former Member
0 Kudos

Hi gurus,

I have created a program to download the team calendar of each organization in an excel file .

My problem is that I dont want to show "sheet1" , "shee2", "sheet3" empties. I wanna delete them, or at least hide them.

I have surf thru SDN with no succeed.

What I have is :

CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
        CALL METHOD OF h_excel 'Workbooks' = h_mapl.
        SET PROPERTY OF h_excel 'Visible'       = 1.
        CALL METHOD OF h_mapl 'Add' = h_map.

        loop of the pages.....
                ............
                GET PROPERTY OF h_excel 'Sheets' = iv_sheet .
                CALL METHOD OF iv_sheet 'Add' = h_map.
                SET PROPERTY OF h_map 'Name' = 'Month XXXX' .
                GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
                 ................
        endloop.

Thanks for your help!

1 REPLY 1

krishnendu_laha
Active Contributor
0 Kudos

Here is a community project for ABAP -> XLSX, which works from my previous system experience...

[ABAP2XLSX|https://cw.sdn.sap.com/cw/groups/abap2xlsx]

Hope it is going to help you.

Thanks