Free Support Forum - aspose.com

Trouble with color

Karen

I am having trouble with color. The following snippet:

Dim OpenCellInfDialog As New OpenFileDialog

OpenCellInfDialog.Title = "Import Cell Information Excel file"

OpenCellInfDialog.Filter = "Cell Inf. Excel Files (*.xls)|*.xls"

OpenCellInfDialog.ShowDialog()

If OpenCellInfDialog.FileName <> "" Then

grdCellInf.ImportExcelFile(OpenCellInfDialog.FileName)

End If

'Freeze first row.

Dim Sheet As Aspose.Grid.Desktop.Worksheet = grdCellInf.GetActiveWorksheet()

Sheet.FrozenRows = 1

'Color first row beige

Dim row As Aspose.Grid.Desktop.GridRow = Sheet.Rows(0)

Dim Style As Aspose.Grid.Desktop.Style = row.GetStyle()

Style.Color = Color.Beige

row.SetStyle(Style)

The Excel file loads and first row freezes as it should, but does not get colored beige. Can't figure out what I am doing wrong with the color.

Tom

Hi Tom,

I tested your code and found Color.Beige did apply to the first row. Since Color.Beige is too slight to be distinguished with Color.White, it seems like nothing was applied to the first row. Maybe you can try other color such as Color.Bisque instead.

Recently we have fixed some bug about merge cells and comments. Please try this attached version.