Home » Developer & Programmer » Forms » working with ole2 and excel (forms 6i)
working with ole2 and excel [message #444762] Wed, 24 February 2010 00:44 Go to next message
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 #444769 is a reply to message #444762] Wed, 24 February 2010 01:22 Go to previous messageGo to next message
shahzam
Messages: 2
Registered: February 2010
Location: malaysia
Junior Member
its ok guys.. got the answers Smile
Re: working with ole2 and excel [message #444775 is a reply to message #444769] Wed, 24 February 2010 02:28 Go to previous message
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.
Previous Topic: Create stacked canvas on Tab page
Next Topic: How to set the backround as transperant colour as form for text item ?
Goto Forum:
  


Current Time: Fri Sep 20 03:47:08 CDT 2024