Your code fails to change appearances because of the insufficient document appearances quantity. The document contains 3 appearances items (1, 2, 3), but your code tries to get items 4 and 0.
I’ve added a pair of appearances and slightly simplified your code.
Here are the results:

Output
------------------------------------------------
Feature Extrusion6 Old Type 20482
Current Operation type: 20485
Feature Extrusion4 Old Type 20481
Current Operation type: 20485
Feature Extrusion3 Old Type 20481
Current Operation type: 20485
Feature Extrusion2 Old Type 20482
Current Operation type: 20485
body 1 colorID = 2
body 2 colorID = 3
body 3 colorID = 4
body 4 colorID = 1
body 5 colorID = 2
Public Sub GenerateCells()
Dim oDoc As PartDocument = oApp.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim extrudefeatures As Inventor.ExtrudeFeatures = oDef.Features.ExtrudeFeatures
Debug.Print("------------------------------------------------")
If (extrudefeatures.Count > 1) Then
For i As Integer = 2 To extrudefeatures.Count
Dim oEF As ExtrudeFeature = extrudefeatures.Item(i)
ChangeOperationType(oEF)
Next
End If
' Color all new solids differenty
' this document must have enough document appearences! n = 1..extrudefeatures.Count
For j As Integer = 1 To oDef.SurfaceBodies.Count
Dim body As SurfaceBody = oDef.SurfaceBodies.Item(j)
Dim colorID As Integer = j Mod 4 + 1
Try
Debug.Print("body " & j & " colorID = " & colorID)
body.Appearance = oDoc.AppearanceAssets.Item(colorID)
Catch ex As Exception
' Some error, gracefully suppressing
MsgBox("Error : " & ex.Message)
End Try
Next
oDoc.Update()
End Sub
Sub ChangeOperationType(ByRef oExtrude As ExtrudeFeature)
Dim oExtrudeDef As ExtrudeDefinition = oExtrude.Definition
Dim oldOperation As PartFeatureOperationEnum = oExtrudeDef.Operation
Debug.Print("Feature " & oExtrude.Name & " Old Type " & oldOperation)
Try
oExtrudeDef.Operation = PartFeatureOperationEnum.kNewBodyOperation
Catch ex As Exception
' Some error, gracefully suppressing
MsgBox("Error : " & ex.Message)
End Try
Dim newOperation As PartFeatureOperationEnum = oExtrudeDef.Operation
Debug.Print("Current Operation type: " & newOperation)
End Sub
cheers,
Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network