void IllusionExcelFile::SetCellColor(long irow, long icolumn,long color){ COleVariant new_color((long)color); excel_current_range_.ReleaseDispatch(); excel_current_range_ = excel_work_sheet_.get_Range(COleVariant(RCString(irow,icolumn)),covOptional); CFont0 font = excel_current_range_.get_Font(); font.put_Color(new_color); }
void IllusionExcelFile::SetCellColor(long irow, long icolumn, int red, int green, int blue){ if(red>255)red=255;else if(red<0)red = 0; if(green>255)green=255;else if(green<0)green = 0; if(blue>255)blue=255;else if(blue<0)blue = 0; COleVariant new_color((long)(blue<<16)|(green<<8)|red); excel_current_range_.ReleaseDispatch(); excel_current_range_ = excel_work_sheet_.get_Range(COleVariant(RCString(irow,icolumn)),covOptional); CFont0 font = excel_current_range_.get_Font(); font.put_Color(new_color); }