Skip to Content
author's profile photo Former Member
Former Member

Regarding deletion of sheet in Excel workbook

Hi,

I got a requirement to add extra sheets and to download all the internal table values into 4 different sheet in Excel.

Created Excel and first internal table value got downloaded to Sheet1 .

remaining 3 internal values i populated by creating 3 different sheets in same workbook.

the above 3 got created infront of sheet1.

now i have to delete the existing sheets 2 and 3 ( default sheets )

even i added and checked CALL METHOD OF iv_sheet 'Delete'. after that also its not getting deleted.

please guide me in this.

Regards,

Priya.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2011 at 12:55 PM

    Hi,

    Have you disable the confirmation prompt by setting the property 'DisplayAlerts' of your application object to false?

    It may be the cause of your issue...

    set property of lo_appl 'DisplayAlerts' = 0.
    call method of lo_sheet 'Delete'. 
    

    Kr,

    Manu.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Manu,

      Thanks a lot for your reply.

      Its working now.

      CALL METHOD OF h_excel 'Worksheets' = iv_sheet

      EXPORTING

      #1 = 2.

      WHILE sy-subrc = 0.

      SET PROPERTY OF h_excel'DisplayAlerts' = 0.

      CALL METHOD OF iv_sheet 'Delete'.

      SET PROPERTY OF h_excel 'DisplayAlerts' = 1.

      CALL METHOD OF h_excel 'Worksheets' = iv_sheet

      EXPORTING

      #1 = 2.

      ENDWHILE.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.