I am sure you know this forum is about AutoCAD VBA. Since you use GetObject(, "AutoCAD.Application"), I assume your code DOES NOT run inside AutoCAD VBA, rather, from other application, such as Excel, right? If so, in the other application (i.e. Excel) VBA, did you add reference to AutoCAD type library? If not, then you are doing "late binding", which would your code more prone to syntext error, because those error would only be caught at runtime, not by compiling the code (VBA menu->Debug->Compile [project]). Also, because of the late binding, the "On Error Resume Next" becomes abused: this line
obj.Select
is completely wrong. No AcadEntity in AutuoCAD document has method "Select()", except for AcadTable, which requires arguments being passed in to its Select() method. But since you have "On Error Resume Next", this line of obvious wrong code got away. The same/similar case, like "Obj.Angle", "Obj.Length", would also cause error, because not all AcadEntity has property "Angle" and/or "Length". If you want to use "On Error Resume Next" to handle possible error, the code to test whether err.Number<>0 SHOULD BE RIGHT AFTER the line that could raise error (i.e. the line where Obj.Angle/Obj.Length is called).
These are the reasons your code skip some lines. By the way, are you sure the other lines (grey ones) are AcadLine, not polyline (AcadLWPolyline)?
If your target entity is AcadLine, you need to test its Type (early binding, with Acad type library referenced), or test its ObjectName (so you can get rid of crappy "On Error Resume Next" and guessing where error could be raised). Something like:
Late binding:
Dim obj As Object
For Each Obj in objDoc.ModelSpace
If UCase(Obj.ObjectName)="ACDBLINE" Then
'' Now you know the object is AcadLine and has "Angle" and "Length" property
'' Do what ever...
End If
Next
Early binding
Dim ent As AcadEntity
For Each ent In ObjDoc.ModelSpace
If TypeOf ent Is AcadLine Then
'' This is AcadLine, go ahead do whatever
End If
Next