08-01-2007 1:54 PM
i have an excel file with two tab sheets.
i use this code but it doesnt work correctly. actually it works but for the first tabsheet.
i want it for the second one only. please help. i wiil reward with points in helpfull answers.
call method of application 'Worksheets' = sheet
exporting
#1 = 2.
set property of sheet 'Name' = 'Timesheets'.
call method of sheet 'Activate'.
CALL METHOD OF gs_chart 'Location'
EXPORTING
#1 = 2
#2 = 'Timesheets'.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_file
i_begin_col = 1
i_begin_row = 7
i_end_col = 1
i_end_row = 60000
tables
intern = itemp
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
clear w_itemp.
loop at itemp.
w_itemp = itemp.
at last.
w_lin = w_itemp-row.
endat.
endloop.
08-01-2007 1:59 PM
Hi See following link :
http://searchsap.techtarget.com/tip/1,289483,sid21_gci868246,00.html?FromTaxonomy=/pr/283958
Reward points if helpful.
Regards.
Srikanta Gope
08-01-2007 2:01 PM
hi,
call method of application 'Worksheets' = sheet
exporting
#1 = 2.
call method of sheet 'Activate'.
set property of sheet 'Name' = 'Timesheets'.
Call method should be before of the Set property
Regards
Sudheer
08-01-2007 2:35 PM