I am trying to set color of a border color, but when I do it and try to access it, it throws an exception
Hi,
Thanks for your posting and using Aspose.Cells.
Please don’t use Style constructor but use Workbook.CreateStyle() method to create a Style object.
Please see the following correct code which works fine.
C#
var style = wb.CreateStyle();
var color = Color.Blue;
var initialColor = style.Borders[BorderType.TopBorder].Color;
style.Borders[BorderType.TopBorder].Color = color;
var lastColor = style.Borders[BorderType.TopBorder].Color;