Free Support Forum - aspose.com

Check background colour of cell

Hi

I am using Desktop.Grid along with VB.Net.

I want to insert a row depending on the existing background colour of a cell.

ie. If sheet.cells() = [backgroundcolour] then insert blank row etc.

How do I find out the background colour of a cell?

Regards

Bob Hamill

Hi Bob,

Thanks for considering Aspose.

May the following code helps you for your need.

Dim sheet As Aspose.Grid.Desktop.Worksheet = GridDesktop1.Worksheets(0)
Dim cell As Aspose.Grid.Desktop.GridCell = sheet.Cells("A1")
If (cell.GetStyle().Color = Color.Red) Then
sheet.InsertRow(2)
End If
Thank you.

Thanks very much again Amjad.

Your work really is appreciated

Regards

Bob Hamill