Hi, I've just been going through Dave Espinosa-Aguilar's excellent Integrating Integrating Autocad and Excel tutorials. I'm trying to tally up the length of lines on layers selected through ThisDrawing.Utility.GetEntity EntObj, PntA, "Select LINE: " which should then create a report in Excel, however the total length of the lines is always 0. Any ideas anyone??? Using the following code:- Public excelApp As Object Public wkbObj As Object Public shtObj As Object Private Sub CommandButton1_Click() 'Code for Select LINEs for length tally CommandButton Dim EntObj As AcadObject Dim PntA As Variant Dim etype As String On Error Resume Next ListBox1.Clear Err.Clear UserForm1.Hide MsgBox ("Right-click or select nothing to exit mode.") ThisDrawing.Utility.GetEntity EntObj, PntA, "Select LINE: " Do While Err = 0 etype = EntObj.ObjectName If etype = "AcDbLine" Then ListBox1.AddItem EntObj.Layer Else MsgBox ("This entity is not a LINE.") End If ThisDrawing.Utility.GetEntity EntObj, PntA, "Select LINE: " Loop ' Delete multiple entries ListBox2.Clear text1$ = ListBox1.List(0) ListBox2.AddItem text1$ For i = 1 To ListBox1.ListCount - 1 text1$ = ListBox1.List(i) found = 0 For j = 0 To ListBox2.ListCount - 1 text2$ = ListBox2.List(j) If text1$ = text2$ Then found = 1 Next j If found = 0 Then ListBox2.AddItem text1$ Next i UserForm1.Show End Sub Private Sub CommandButton2_Click() 'Code for Create Spreadsheet Dim EntObj As AcadObject Dim lname As String Dim ename As String Dim test As String Dim tot As Integer On Error Resume Next UserForm1.Hide Err.Clear Set excelApp = CreateObject("Excel.Application") If Err <> 0 Then MsgBox "Could not start Excel", vbExclamation End Else excelApp.Visible = True Set wbkObj = excelApp.Workbooks.Add Set shtObj = excelApp.Worksheets(1) shtObj.Cells(i + 1, 1) = "Layer Name" shtObj.Cells(i + 1, 2) = "Total Length" For i = 0 To ListBox2.ListCount - 1 tot = 0 test = ListBox2.List(i) For j = 0 To ThisDrawing.ModelSpace.Count '-1 Set EntObj = ThisDrawing.ModelSpace.Item(j) lname = EntObj.Layer ename = EntObj.ObjectName If lname = test And ename = "AcDdLine" Then tot = tot + EntObj.Length End If Next j shtObj.Cells(i + 2, 1) = test shtObj.Cells(i + 2, 2) = tot Next i End If UserForm1.Show End Sub Private Sub CommandButton3_Click() 'Code for Quit CommandButton End End Sub