[dbb2008]笨笨 00:17:56
Sub aq()
Dim bobj As AcadBlockReference
Dim a
Dim arr()
Dim ss As AcadSelectionSet
Dim filtertype(0 To 0) As Integer
Dim filterdata(0 To 0) As Variant
Dim xls As Excel.Application
Set xls = New Excel.Application
Set ss = ThisDrawing.SelectionSets.Add(CStr(Rnd))
filtertype(0) = 0
filterdata(0) = "insert"
ss.SelectOnScreen filtertype, filterdata
For Each bobj In ss
i = i + 1
ReDim  reserve arr(1 To i)
a = bobj.GetAttributes
arr(i) = a(0).TextString
Next
With xls.Workbooks.Add
.Sheets(1).[a1].Resize(i, 1) = xls.Transpose(arr)
.SaveAs "d:/123.xls"
.Close
End With
xls.Quit
End Sub
[qqimg]201311/{927EADFC-E7CB-9BC4-7BB0-205D117A1241}.jpg[/qqimg]
为什么会显示未定义类型呢? |