I am trying to fill a cell in Excel (2003) on Windows with the colour black. I get the following error;
Exception code 0: Unable to set the ColorIndex property of the Interior class, (failed on “ColorIndex”)
The line I am using is this
excel.range("B"+str(c)).Interior.ColorIndex=1
I would ideally like to fill the cell with a diagonal pattern but the VBA doesn’t seem to translate very well. Any suggestions appreciated;
VBA code below;
// With Selection.Interior
// .ColorIndex = 0
// .Pattern = xlUp
// .PatternColorIndex = xlAutomatic
// End With
// End Sub
No its working fine, I think it may have been a problem with the worksheet being protected - even though the cells I was changing were editable areas. I have unprotected the sheet and it works fine now.