Format Excel Worksheet of workbook in MSD axapta

This is code hints to Format Excel Worksheet of workbook in axapta. You excel workbook will be in xls or in higher version. You can open excel sheet by using visible true property then you can use other properties like font,style etc    

    SysExcelApplication     excelApp;  
    SysExcelWorkbooks      XLSWorkbooks;  
    SysExcelWorkbook      XLSWorkbook;  
    SysExcelWorksheet      sheet;  
    SysExcelRange        range;  
    SysExcelStyles       styles;  
    SysExcelStyle        style;  
    SysExcelInterior      interior;  
    SysExcelFont        font;  
    COM             _char, RangeComObj;  
    excelApp    = SysExcelApplication::construct();  
    XLSWorkbooks    = excelApp.workbooks();  
    XLSWorkbook    = XLSWorkbooks.add();  
    sheet    = excelApp.activeSheet();  
    range    = sheet.range('A1');  
    styles   = XLSWorkbook.styles();  
    style    = styles.add('MyStyle');  
    interior  = style.interior();  
    interior.color(WinApi::RGB2int(246, 233, 206));  
    font    = style.font();  
    font.color(winapi::RGB2int(153, 204, 255));'MyStyle');  
    RangeComObj     = range.comObject();  
    _char    = RangeComObj.characters(1);