Free Support Forum - aspose.com

SetStyle vs Style.ForegroundColor

With the current cells dll (4.8.2.5) I get a warning that Aspose.Cells.Style is obsolete. What is the new way to code the following:

wsDest.Cells(x, nDestColumn).Style.ForegroundColor = Color.Yellow
wsDest.Cells(x, nDestColumn).Style.Pattern = BackgroundType.Solid

Rick

Hi Rick,

Please try to use Cell.GetStyle and Cell.SetStyle methods which are more efficient and optimized related performance.

Dim s As Style = wsDest.Cells(x, nDestColumn).GetStyle()
s.ForegroundColor = Color.Yellow
s.Pattern = BackgroundType.Solid
wsDest.Cells(x, nDestColumn).SetStyle(s)

For further reference, kindly see the document:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/reuse-of-style-objects.html

Thank you.