Hello Group ive been a cad user for a few years and now I'm trying to get my head around acad VBA. I have bought mastering AutoCAD VBA by Sybex. when I try to run listing 16.2 I get the following error Compile error: User-defined type not defined. the following is the code I am trying to run Option Explicit Public Sub DrawAutoCADLine() 'sending line data to AutoCAD Dim AutoCADApplication As AutoCAD.Application Dim StartLine(0 To 2) As Double Dim EndLine(0 To 2) As Double Set AutoCADApplication = CreateObject("AutoCAD.Application") StartLine(0) = Cells(2, 2).Value StartLine(1) = Cells(3, 2).Value EndLine(0) = Cells(2, 3).Value EndLine(1) = Cells(3, 3).Value AutoCADApplication.ActiveDocument.ModelSpace.AddLine StartLine, EndLine End Sub is there something wrong with the code or am I doing something wrong myself ? TIA Dave