Hi @PappaJeff. Add "ComponentDefinition" (unquoted) between "oDoc" variable and "Sketches" on Line 3, then specify what type of object the variable represents also, like this:
For Each oSketch As PlanarSketch In oDoc.ComponentDefinition.Sketches
'or get the sketches to a variable first, then iterate through its members, like this:
Dim oSketches As PlanarSketches = oDoc.ComponentDefinition.Sketches
For Each oSketch As PlanarSketch In oSketches
Edit: Actually, there are more problems that just that within your code above. It would be easier to copy, edit, then post back here again, if you copied your real code text, then pasted that text here in a response. But if/when you do, use the </> symbol within the forum response tools to post your code within a code window, like in this response. It is easier to look at and work with that way.
One of the things that should change is changing "Else If" to "ElseIf" (no space between Else and If). Another thing is that the same single Sketch mentioned at the start of the 'loop' should not be renamed that many times, because that's what it looks like it would by trying to do. You would need a bunch of If...Then statements added in there for each sketch name you want to check for.
Wesley Crihfield

(Not an Autodesk Employee)