working with ole2 and excel [message #444762] |
Wed, 24 February 2010 00:44 |
shahzam
Messages: 2 Registered: February 2010 Location: malaysia
|
Junior Member |
|
|
hi guys.. this is my code
args := ole2.create_arglist;
ole2.add_arg (args, 1);
ole2.add_arg (args, 1);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
ole2.set_property(cell,'Value','Report Title');
my question is, how can i bold and centered the value of the current cell? Thanks
|
|
|
|
Re: working with ole2 and excel [message #444775 is a reply to message #444769] |
Wed, 24 February 2010 02:28 |
tamzidulamin
Messages: 132 Registered: October 2009 Location: Dhaka
|
Senior Member |
|
|
Dear,
try the following code:
Declare
ExcelFontId OLE2.list_type;
range OLE2.OBJ_TYPE;
range_col OLE2.OBJ_TYPE;
Begin
-- Set Font Attribute
ExcelFontId := OLE2.get_obj_property(Cell, 'Font');
OLE2.set_property(ExcelFontId, 'Bold', 'True');
-- Autofit columns
range := OLE2.GET_OBJ_PROPERTY( worksheet,'UsedRange');
range_col := OLE2.GET_OBJ_PROPERTY( range,'Columns');
OLE2.INVOKE( range_col,'AutoFit' );
OLE2.RELEASE_OBJ( range );
OLE2.RELEASE_OBJ( range_col );
End;
Regards,
Tamzidul Amin.
|
|
|