cancel
Showing results for 
Search instead for 
Did you mean: 

OLE2 to Excel: switch to specific worksheet

andreas_gnther
Discoverer
0 Kudos
216

Hello,

I have to read data from an excel file with several worksheets. Function module ALSM_EXCEL_TO_INTERNAL_TABLE does this, but takes always the first worksheet. So I created a copy of the FM to switch to a specific worksheet with a given name. But with everything I tried, I failed. How can I do the switch?

Thanks in advance

Andreas Günther

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

For e.g., you wanna activate sheet 'My Sheet'. Statements as below:

CALL METHOD OF workbook 'Worksheets' = worksheet

EXPORTING #1 = 'My Sheet'.

CALL METHOD OF worksheet 'Activate'.

andreas_gnther
Discoverer
0 Kudos

Hi Ben,

thanks. It works when I change "workbook" to "application".