Code: Alles auswählen.
CREATE OBJECT o_appl 'EXCEL.APPLICATION'.
IF sy-subrc NE 0.
MESSAGE 'Error' TYPE 'E'.
ENDIF.
SET PROPERTY OF o_appl 'VISIBLE' = 1.
CALL METHOD OF o_appl 'workbooks' = o_workbooks.
CALL METHOD OF o_workbooks 'add'.
CALL METHOD OF o_appl 'cells' = o_cells.
CALL METHOD OF o_cells 'select'.
CALL METHOD OF o_appl 'selection' = o_selection.
SET PROPERTY OF o_selection 'locked' = 0.
CALL METHOD OF o_appl 'ActiveSheet' = o_actsheet.
CALL METHOD OF o_actsheet 'Cells' = o_cellstart
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF o_actsheet 'Cells' = o_cellend
EXPORTING
#1 = 4
#2 = 4.
CALL METHOD OF o_actsheet 'range' = o_range
EXPORTING
#1 = o_cellstart
#2 = o_cellend.
CALL METHOD OF o_range 'select'.
CALL METHOD OF o_appl 'selection' = o_selection.
SET PROPERTY OF o_selection 'locked' = 1.
CALL METHOD OF o_actsheet 'protect'
EXPORTING
#01 = ''
#02 = 1
#03 = 1
#04 = 1.