Since the AutoCAD is 64-bit, in its COM object model, the ObjectId/OwnerId is 64-bit integer (type of LongLong), which is not supported in 32-bit environment (your 32-bit Excel), thus the run-time error when the line of code containing something like xxxx.ObjectID or xxxx.OwnerID is executed.
In fact, in Excel VBA editor, after setting reference to AutoCAD type library, if you click menu "Debug->Compile VBAProject", Excel would be frozen/crash (this is what happens to my computer with 64-bit Acad2018 and 32-bit Excel).
However, there is a workaround you could try: use late binding. That is, if you need to access property ObjectID/OwnerID, you declare the property owner as "object". This code works for me:
Option Explicit
Public Sub CadATest()
Dim cadApp As object
On Error Resume Next
Set cadApp = GetObject(, "AutoCAD.Application")
If Err.Number = 0 Then
SearchEntities cadApp
Else
MsgBox "Cannot connect to a running AutoCAD session!"
End If
End Sub
Private Sub SearchEntities(cadApp As AcadApplication)
Dim dwg As object
Dim ent As object
Set dwg = cadApp.ActiveDocument
If Not dwg Is Nothing Then
For Each ent In dwg.ModelSpace
MsgBox ent.OwnerID
Next
End If
End Sub
With this case, there is no reference to AutoCAD type library set.
If you want to take advantage of early binding's intelisense, you can still set reference to AutoCAD type library, and declare most object to specific type, but make sure to declare those object as "object", to which you want to access its ObjectID/OwnerID. This code also works for me
Option Explicit
Public Sub CadATest()
Dim cadApp As AcadApplication
On Error Resume Next
Set cadApp = GetObject(, "AutoCAD.Application")
If Err.Number = 0 Then
SearchEntities cadApp
Else
MsgBox "Cannot connect to a running AutoCAD session!"
End If
End Sub
Private Sub SearchEntities(cadApp As AcadApplication)
Dim dwg As AcadDocument
Dim ent As Object
Set dwg = cadApp.ActiveDocument
If Not dwg Is Nothing Then
For Each ent In dwg.ModelSpace
MsgBox ent.OwnerID
Next
End If
End Sub
HTH