ABAP OLE相关的应用
??call method of excel_obj 'Range'= range_obj
??? exporting #1= 'D4'.
? call method of range_obj 'Select' .
? call method of excel_obj 'ActiveWindow' =window_obj.
? set property of window_obj 'FreezePanes' =1.
?
此代碼將excel從前三列和前三開始將窗體凍結
?
隱藏列
?
? callmethod of excel_obj 'Columns' = column_obj
??? exporting #1= 'E:I' .
? call method of column_obj 'Select' .
? set property of column_obj 'Hidden' = 1.
?
增加批注
?
?call method of excel_obj 'Range'= range_obj
????exporting #1 = 'B5' .
? call method of range_obj 'Select' .
? call method of range_obj 'AddComment' exporting#1 = '系統注釋:你可以查看zmb51'.
?
設置背景
?
? call method of sheet_obj 'Range' = range_objexporting #1 = 'B5' .
? call method of range_obj 'Interior' =Interior_obj.
? set property of Interior_obj 'ColorIndex' = 3.
?
合并單元格
?
form set_cell_union using i j val.
? CALL METHOD OF excel_obj 'Range' =range_obj
??? EXPORTING #1= i #2 = j .
? SET PROPERTY OF range_obj 'MergeCells' =1.
? SET PROPERTY OF range_obj 'Value' = val .
endform.
?
運行宏
?
perform runmacro using 'deleteRows'.
?
FORM runmacro USING macroname.
? CALL METHOD OF excel_obj 'RUN'
?????EXPORTING
?????????#1 = macroname.
ENDFORM.
?
設置邊框(設置區域邊框)
?
FORM set_cell_border2 using s e w.
? CALL METHOD OF excel_obj 'Range' =range_obj
?? EXPORTING #1 = s
????????????#2 = e.
? GET PROPERTY OF range_obj 'Borders' =borders_obj .
? SET PROPERTY OF borders_obj 'LineStyle' = '1'.
*? SET PROPERTY OF borders_obj 'WEIGHT' =w.
? FREE OBJECT borders_obj.
ENDFORM.
總結
以上是生活随笔為你收集整理的ABAP OLE相关的应用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用动态内表——ALV输出
- 下一篇: 好用的函数ABAP