OLE行复制
代码注释部分也可以复制行,但是行高变小了
DATA: LCL_CELL1 TYPE OLE2_OBJECT,
LCL_CELL2 TYPE OLE2_OBJECT,
LCL_CELL3 TYPE OLE2_OBJECT,
LCL_CELL4 TYPE OLE2_OBJECT,
LCL_RANGE1 TYPE OLE2_OBJECT,
LCL_RANGE2 TYPE OLE2_OBJECT,
LV_ROW1 TYPE I VALUE 26.
DO GV_LINES - 1 TIMES.
LV_ROW1 = LV_ROW1 + 1.
* CALL METHOD OF GCL_SHEET 'Cells' = LCL_CELL1
* EXPORTING #1 = 26
* #2 = 1.
*
* CALL METHOD OF GCL_SHEET 'Cells' = LCL_CELL2
* EXPORTING #1 = 26
* #2 = 18.
*
* CALL METHOD OF GCL_SHEET 'Range' = LCL_RANGE1
* EXPORTING #1 = LCL_CELL1
* #2 = LCL_CELL2.
*
* CALL METHOD OF LCL_RANGE1 'Select'.
*
* CALL METHOD OF LCL_RANGE1 'Copy'.
*
* CALL METHOD OF GCL_SHEET 'Cells' = LCL_CELL3
* EXPORTING #1 = LV_ROW1
* #2 = 1.
*
* CALL METHOD OF GCL_SHEET 'Cells' = LCL_CELL4
* EXPORTING #1 = LV_ROW1
* #2 = 18.
*
* CALL METHOD OF GCL_SHEET 'Range' = LCL_RANGE2
* EXPORTING #1 = LCL_CELL3
* #2 = LCL_CELL4.
*
* CALL METHOD OF LCL_RANGE2 'Insert'.
*
* CALL METHOD OF LCL_RANGE2 'ClearContents'.
call METHOD of gcl_sheet 'Rows' = LCL_RANGE1
EXPORTING
#1 = 26.
CALL METHOD OF LCL_RANGE1 'Copy'.
CALL METHOD OF GCL_SHEET 'Rows' = LCL_RANGE1
EXPORTING
#1 = LV_ROW1.
CALL METHOD OF LCL_RANGE1 'INSERT'.
CALL METHOD OF LCL_RANGE1 'ClearContents'.
ENDDO.
注释代码效果: