Hi Experts
I have created a excel program to read data from Excel multiple sheets
I was able to read the data earlier from multiple sheet but now I am getting a strange problem
Only two sheet are always read
Even though I am passing the third sheet name only 2nd sheet data is being fetched
The other problem is If I open the excel file ,opened third worksheet and closed it.
The program starts reading the data from 3rd worksheet but not from worksheet 1
Can you please provide the solution for this or what I am missing here when working with excel
Please find the code what I have written to read the data from multiple sheets and correct me if I am doing anything wrong
LOOP AT i_sheets INTO wa_sheets.
lw_range-name = 'Test'.
lw_range-rows = p_rows.
lw_range-columns = p_cols.
APPEND lw_range TO lt_range.
CALL METHOD iref_spreadsheet->select_sheet
EXPORTING
name = wa_sheets-sheet_name
* no_flush = ' '
IMPORTING
error = iref_error
* retcode =
.
IF iref_error->has_failed = 'X'.
EXIT.
ENDIF.
CALL METHOD iref_spreadsheet->set_selection
EXPORTING
top = 1
left = 1
rows = p_rows
columns = p_cols.
CALL METHOD iref_spreadsheet->insert_range
EXPORTING
name = 'Test'
rows = p_rows
columns = p_cols
no_flush = ''
IMPORTING
error = iref_error.
IF iref_error->has_failed = 'X'.
EXIT.
ENDIF.
REFRESH i_data.
CALL METHOD iref_spreadsheet->get_ranges_data
* EXPORTING
* all = 'X'
IMPORTING
contents = i_data
error = iref_error
CHANGING
ranges = lt_range.
CALL METHOD iref_spreadsheet->delete_ranges
EXPORTING
ranges = lt_range.
endloop.
is there any special procedure we need to follow while saving the excel which I am using for the program
Thanks
Pawan Akella