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: 

Regarding deletion of sheet in Excel workbook

former_member212001
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member

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.

2 REPLIES 2

Former Member

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.

0 Kudos

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.