If you don't have a reference checked in the tools > reference > AutoCad xxxx type library it will have errors, the getobject function will not work. I am sorry I forgot to tell you that.
Public Graphics As AcadApplication Public Sub OpnAcad() Dim AngBracDwg As String On Error Resume Next 'I added this line Set Graphics = GetObject(, "AutoCAD.Application") If Err.Description > vbNullString Then Err.Clear Set Graphics = CreateObject("AutoCAD.Application") End If AngBracDwg = "c:\dwg\ba1.dwg" Graphics.Documents.Open (AngBracDwg) On Error goto 0 End Sub




Reply With Quote