Private Function StartAutoCAD() As Object On Error Resume Next Dim AcadApp As Object ' Get the active session of AutoCAD using late binding AcadApp = GetObject(, "AutoCAD.Application.17.1") If Err.Number <> 0 Then Err.Clear() Shell("c:\Program Files\Common Files\Autodesk Shared\WSCommCntr1.exe", AppWinStyle.NormalFocus) ' Create a new session of AutoCAD using late binding AcadApp = CreateObject("AutoCAD.Application.17.1") End If Return AcadApp End Function Private Sub Test() Dim AcadApp As Object Dim dbxDoc As Object AcadApp = StartAutoCAD() AcadApp.Visible = True dbxDoc = AcadApp.GetInterfaceObject("ObjectDBX.AxDbDocument.17") dbxDoc = AcadApp.activedocument Dim ms As Object ms = dbxDoc.ModelSpace MsgBox(ms.Count.ToString + " objects in in model space") Dim entity As Object For Each entity In dbxDoc.ModelSpace If TypeOf entity Is BlockReference Then MsgBox(entity.name) End If Next entity dbxDoc = Nothing AcadApp.Application.Quit() AcadApp = Nothing End Sub