人法地,地法天,天法道,道法自然
分类:
2009-05-05 22:48:36
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从前三列和前三开始将窗体冻结
隐藏列
call method 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_obj exporting #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.