matinal:SAP ABAP 如何使用OLE复制行和复制SHEET

2023-10-14 15:28:52 浏览数 (2)

代码语言:javascript复制
DATA lc_range TYPE ole2_object.
DATA lv_sheet TYPE ole2_object.
DO 2 TIMES.
  CALL METHOD OF lv_sheet 'Rows' = lc_range
    EXPORTING #1 = 7.
  CALL METHOD OF lc_range 'Copy'.  "COPY第6行插入一个新行
  CALL METHOD OF lv_sheet 'Rows' = lc_range
    EXPORTING #1 = 7 .
  CALL METHOD OF lc_range 'Insert'.
  CALL METHOD OF lc_range 'ClearContents'. "是否需要清空Cell

ENDDO .

CALL METHOD OF lv_sheet 'copy'
  EXPORTING
    #1 = lv_sheet.

SET PROPERTY OF lv_sheet 'name' = 'hhh'.
CALL METHOD OF lv_sheet 'ACTIVATE'.

0 人点赞