Skip to Content
0
Former Member
Jun 05, 2007 at 05:29 AM

How to download data in multiple sheets of one excel file

15 Views

Hello,

I want to download data in multiple sheets of one excel file ..through ole2_object.

i have created program but it is not it is not giving the desird op.

here is the code..

create object excel 'EXCEL.APPLICATION'.

call method of excel 'WORKBOOKS' = books.

call method of books 'ADD' = book1.

*****************" Here we r creating the first sheet.

if flag1 = 'X'.

call method of book1 'WORKSHEETS' = SHEET

EXPORTING

#1 = 1. " here 1 indicating the position of sheet means first position.

call method of sheet 'Activate'.

set property of sheet 'Name' = 'Developments_Summary_Report'.

perform excel_fill.

endif.

*****************" Here we r creating the second sheet.

if flag2 = 'X'.

call method of book1 'WORKSHEETS' = SHEET

EXPORTING

#1 = 2. " here 2 indicating the position of sheet means second position.

call method of sheet 'Activate'.

set property of sheet 'Name' = 'BDC_Developments_Report'.

perform excel_fill.

endif.

set property of excel 'VISIBLE' = 1. " due to this property excel window is visible.

call method of excel 'QUIT'.

but it is generating the two different excel file ..

Thanks in advance,

Paresh.