Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed Mar 18, 2015 3:27 pm

hi i've this code:
sheet.Range[_range].Style.Color = Color.FromArgb(141, 180, 226);

but the result when i open the exell is color rgb 153,204,255

ict@sogedin.it
 
Posts: 63
Joined: Mon Jul 15, 2013 2:06 pm

Thu Mar 19, 2015 4:12 am

hello,

Thank you for your inquiry.
Excel2003 only supports dozens of predefined colors, if you create Excel2003 file, it will find the nearest predefined color RGB value according to the setting of color RGB you used.
Please use Excel 2007 and above version.
Code:
Code: Select all
  Workbook workbook = new Workbook();
  workbook.Version = ExcelVersion.Version2007;
  workbook.Worksheets[0].Range[_range].Style.Font.Color = Color.FromArgb(141, 180, 226);
  workbook.SaveToFile("test.xlsx",ExcelVersion.Version2007);
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Mon Mar 23, 2015 6:58 am

Hello,

Has your issue been resolved? Could you please give us some feedback at your convenience?

Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Return to Spire.XLS