Application Development and Automation 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: 
Read only

Delete sheet from excel file using ABAP

Former Member
0 Likes
2,165

Dear All,

I am facing problem of deleting SHEET from excel file.

Situation,

I am creating excel file with sheet 1 and sheet 2 with data. When I create excel default system will create sheet 1 to 3.

Here I dont want sheet. so I am trying to delete using

  • CALL METHOD OF APPLICATION 'Worksheets' = SHEET

  • EXPORTING #1 = 3.

    • CALL METHOD OF SHEET 'Activate'.

  • CALL METHOD OF SHEET 'DELETE' .

But system is popping confirmation msg with OK and cancel buttons.

Please help me how to handle this...

or any way to delete sheet from excel file...

Thnaks

Rays

Dear All,

I am facing problem of deleting SHEET from excel file.

Situation,

I am creating excel file with sheet 1 and sheet 2 with data. When I create excel default system will create sheet 1 to 3.

Here I dont want sheet. so I am trying to delete using

  • CALL METHOD OF APPLICATION 'Worksheets' = SHEET

  • EXPORTING #1 = 3.

    • CALL METHOD OF SHEET 'Activate'.

  • CALL METHOD OF SHEET 'DELETE' .

But system is popping confirmation msg with OK and cancel buttons.

Please help me how to handle this...

or any way to delete sheet from excel file...

Thnaks

Rays

4 REPLIES 4
Read only

Former Member
0 Likes
1,256

hi

what is the class you are using to call the method?

pavan

Read only

0 Likes
1,256

Hi Pavan,

I declared as

*Declaration for Excel

DATA: APPLICATION TYPE OLE2_OBJECT,

WORKBOOK TYPE OLE2_OBJECT,

SHEET TYPE OLE2_OBJECT,

CELLS TYPE OLE2_OBJECT,

H_F TYPE OLE2_OBJECT. " font

And I created excel file and saved success fully....Only thing I want is I need to delete extra sheet.

Thanks & regards,

Rayudu

Read only

Former Member
0 Likes
1,256

GO TO SE 37 SEARCH FOR FUNCTION MODULE WITH NAME STARTING FROM

ALSMDELETEFILE/SHEET

Read only

Former Member
0 Likes
1,256

Hi

I didnot get delete methord attributes...

I found alternative solution i.e I set visible property of the sheet to 2.

Its not visible any more..

Rays