Help with acad VBA

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Provided that 'Cells' is defined somewhere else, the following should be OK:
Public Sub DrawAutoCADLine() 'sending line data to AutoCAD Dim AutoCADApplication As Object ....
Ben

around
EndLine
myself
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.