2015 Jul 16 8:29 AM
Hi,
Please let me know any method which helps to change the active sheets in the excel file.
I have a requirement to read data from multiple sheets in a file. I have done the same but performance is good, So i have an alternate idea.
so if you know any method which helps to change the active sheets in excel please help.
thanks,
muthu
2015 Jul 16 8:45 AM
Hi Muthu ,
As per your requirement of reading data from Multiple Sheets there are two methods:
1) Using OLE Object method - advantage of using this is that we can control all excel functionality ,but disadvantage is that it requires too much of coding effort and have to write code for each excel cells.
I will not recommend this method .
2) Using OOPS Method : there are standard class method using which we can read data from multiple sheets , I will recommend this method as I have used the same method and got good performance. Also same method is used in standard applications.
Use class: CL_FDT_XL_SPreadsheet - create its instance LREF_EXCEL
Use Function Module GUI_UPLOAD to upload the excel file -> later use SCMS_BINARY_TO_XSTRING
Use LREF_EXCEL to get list of worksheet names
later loop at all sheets - use methods select_sheet set_selection , insert_range get_ranges_data to read values into selection table..