i am usign the following code to change the background color of a cell :
xl.Range(rng).Select()
With xl.Selection.interior()
MsgBox(.ColorIndex)
If .ColorIndex = -4142 Then
.ColorIndex = 6
.Pattern = Excel.XlPattern.xlPatternSolid
Else
.ColorIndex = -4142
.Pattern = Excel.XlPattern.xlPatternSolid
End If
end with
this should change the color but it isnt do i need to refresh the sheet? or something. the reason the code looks a lil diff is because its in .net but it should work .