In reference to the color table from http://www.aspose.com/Products/Aspose.Cells/Api/index.html?url=http://www.aspose.com/Products/Aspose.Cells/Api/Aspose.Cells.Workbook.ChangePalette.html
I am trying to loop through the colors available in the current palette to display them in cells with this code and it is not working:
Public Shared Sub TestColors(ByVal mWorkBook As Aspose.Cells.Workbook, ByVal pSheet As Worksheet, ByRef pRow As Integer)
For intI As Integer = 0 To 55
With pSheet.Cells(pRow, 0)
.PutValue("Test")
.Style.ForegroundColor = mWorkBook.Colors(intI)
End With
pRow += 1
Next
End Sub
Can I display a sample of all the colors of the current palette?
Please add a line to your code to make it work i.e.,
Public Shared Sub TestColors(ByVal mWorkBook As Aspose.Cells.Workbook, ByVal pSheet As Worksheet, ByRef pRow As Integer)
For intI As Integer = 0 To 55
With pSheet.Cells(pRow, 0)
.PutValue("Test")
.Style.ForegroundColor = mWorkBook.Colors(intI)
.Style.Pattern = BackgroundType.Solid;
End With
pRow += 1
Next
End Sub
For further reference, please check the following thread: