Public Sub openfile()
on error resume next
Dim acadapp As AcadApplication
Set acadapp = GetObject(, "acad.application")
If Err Then
Err.Clear
Set acadapp = CreateObject(, "acad.application")
End If
acadapp.Visible = True
Dim myFilename As String
myFilename = "C:\123.dwg"
acadapp.Documents.Open myFilename