Sub Test()
Dim CadApp As AcadApplication
Dim CadDwg As AcadDocument
Dim textObj As AcadText
Dim pt2(0 To 2) As Double
'<><><><><><><><><><><><><><><><><><><><><>
' Connect to AutoCAD
'<><><><><><><><><><><><><><><><><><><><><>
On Error Resume Next
Set CadApp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then 'Not Running
Set CadApp = CreateObject("AutoCAD.Application")
Err.Clear
End If
On Error GoTo ErrHndlr
'<><><><><><><><><><><><><><><><><><><><><>
' Open the Drawing Template
'<><><><><><><><><><><><><><><><><><><><><>
sDwgTemplate = "C:\Temp\A5-Template.dwg"
If Dir(sDwgTemplate) <> "" Then
CadApp.Documents.Open sDwgTemplate
Else
MsgBox "File " & sDwgTemplate & " does not exist."
End If
'<><><><><><><><><><><><><><><><><><><><><>
' Update Drawing
'<><><><><><><><><><><><><><><><><><><><><>
Set CadDwg = CadApp.ActiveDocument
pt2(x) = 8.6422: pt2(y) = 7.1831: pt2(z) = 0
'Insert 1/8" text at pt 2
Set textObj = CadDwg.ModelSpace.AddText("Test", pt2, 0.125)
CadApp.ZoomExtents
' CadDwg.SaveAs ("FullPath and New File Name Here")
CleanUp:
Set CadDwg = Nothing
Set CadApp = Nothing
Set textObj = Nothing
Exit Sub
ErrHndlr:
CadApp.Visible = False
MsgBox "Error in Test()" & vbCrLf & vbCrLf & _
"Error No. " & Err.Number & vbCrLf & _
"Description: " & Err.Description
Err.Clear
CadApp.Visible = True
End Sub