1 DATA lc_range TYPE ole2_object.
2 DATA lv_sheet TYPE ole2_object.
3 DO 2 TIMES.
4 CALL METHOD OF lv_sheet 'Rows' = lc_range
5 EXPORTING #1 = 7.
6 CALL METHOD OF lc_range 'Copy'. "COPY第6行插入一个新行
7 CALL METHOD OF lv_sheet 'Rows' = lc_range
8 EXPORTING #1 = 7 .
9 CALL METHOD OF lc_range 'Insert'.
10 CALL METHOD OF lc_range 'ClearContents'. "是否需要清空Cell
11
12 ENDDO .
13
14 CALL METHOD OF lv_sheet 'copy'
15 EXPORTING
16 #1 = lv_sheet.
17
18 SET PROPERTY OF lv_sheet 'name' = 'hhh'.
19 CALL METHOD OF lv_sheet 'ACTIVATE'.