Hi,
Your code is working fine.But when I have written below code in function and calling that function for each cells with a particular condition.It is giving black color.
pls find the attachment those colors i want for my coloumn and rows.I could able to get lightyellow,it is showing different yellow color.
Can you please help to find out the solution.
cells.Item(intRowCounter, 2).Style = SetGoldColorHeader(excel)
Function SetGoldColorHeader(ByVal excel As Excel) As Style
Dim styles As styles = excel.Styles
Dim styleIndex As Integer = styles.Add()
Dim style As Aspose.Excel.Style = styles(styleIndex)
style.Font.Size = 10
style.Font.Color = Color.Black
style.Font.IsBold = True
style.Font.Name = "Arial"
style.IsTextWrapped = True
style.IndentLevel = 0
style.Borders(BorderType.BottomBorder).LineStyle = CellBorderType.Thick
style.Borders(BorderType.TopBorder).LineStyle = CellBorderType.Thin
style.Borders(BorderType.LeftBorder).LineStyle = CellBorderType.Thin
style.Borders(BorderType.RightBorder).LineStyle = CellBorderType.Thin
style.HorizontalAlignment = TextAlignmentType.Center
style.VerticalAlignment = TextAlignmentType.Bottom
excel.ChangePalette(Color.Gold, 55)
style.ForegroundColor = Color.Gold
style.Pattern = BackgroundType.Solid
Return style
End Function
Thanks,
Arun