<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Runtime Error '13' Type mismatch on GetAttributes Method in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534868#M37485</link>
    <description>Jeff&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the insight as I did not realize this.  It seems like such a &lt;BR /&gt;
small thing but had me stumped. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Dustin&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jeff Mishler" &lt;MIFFATSONICDOTNETIS_ALL&gt; wrote in message &lt;BR /&gt;
news:5063306@discussion.autodesk.com...&lt;BR /&gt;
Assigning objects to a Variant type Variable don't need a Set .....all you&lt;BR /&gt;
need is:&lt;BR /&gt;
&lt;BR /&gt;
objAttributes = objBlockReference.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
"Dustin Wilson" &lt;DWILSON&gt; wrote in message&lt;BR /&gt;
news:5063247@discussion.autodesk.com...&lt;BR /&gt;
I have a small script that will extract the attributes from a block but I&lt;BR /&gt;
get a Runtime Error '13' - Type Mismatch when I get to the line:&lt;BR /&gt;
&lt;BR /&gt;
Set objAttributes = objBlockReference.GetAttributes&lt;/DWILSON&gt;&lt;/MIFFATSONICDOTNETIS_ALL&gt;</description>
    <pubDate>Thu, 19 Jan 2006 12:38:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-01-19T12:38:03Z</dc:date>
    <item>
      <title>Runtime Error '13' Type mismatch on GetAttributes Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534866#M37483</link>
      <description>I have a small script that will extract the attributes from a block but I &lt;BR /&gt;
get a Runtime Error '13' - Type Mismatch when I get to the line:&lt;BR /&gt;
&lt;BR /&gt;
Set objAttributes = objBlockReference.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
Can anyone tell me what I'm doing wrong here?  I have a listing of my code &lt;BR /&gt;
below&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Dustin&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Public Sub TEST()&lt;BR /&gt;
On Error GoTo ErrorHandler&lt;BR /&gt;
&lt;BR /&gt;
   Dim objSelectionSets As AcadSelectionSets&lt;BR /&gt;
   Dim objSelectionSet As AcadSelectionSet&lt;BR /&gt;
   Dim intSelectionSetType(0) As Integer&lt;BR /&gt;
   Dim objSelectionSetData(0) As Variant&lt;BR /&gt;
   Dim intSelectionSetCounter As Integer&lt;BR /&gt;
   Dim objApplication As AcadApplication&lt;BR /&gt;
   Dim objBlockReference As AcadBlockReference&lt;BR /&gt;
   Dim objAttributes As Variant 'AcadAttribute 'Variant&lt;BR /&gt;
   Dim lngAttributesCounter As Long&lt;BR /&gt;
   Dim lngSelectionSetCounter As Long&lt;BR /&gt;
&lt;BR /&gt;
   Dim strTitleBlock(9) As String&lt;BR /&gt;
&lt;BR /&gt;
   '* Select all Selection Sets within Drawing&lt;BR /&gt;
   Set objSelectionSets = ThisDrawing.SelectionSets&lt;BR /&gt;
&lt;BR /&gt;
   If objSelectionSets.Count &amp;gt; 0 Then&lt;BR /&gt;
&lt;BR /&gt;
      '* Remove all existing selection sets for the drawing&lt;BR /&gt;
      For Each objSelectionSet In objSelectionSets&lt;BR /&gt;
         objSelectionSet.Delete&lt;BR /&gt;
      Next&lt;BR /&gt;
&lt;BR /&gt;
   End If&lt;BR /&gt;
&lt;BR /&gt;
      strBlockName = "CPITITLE"&lt;BR /&gt;
&lt;BR /&gt;
      '* Filter for all Text&lt;BR /&gt;
      intSelectionSetType(0) = 2&lt;BR /&gt;
      objSelectionSetData(0) = Trim(strBlockName)&lt;BR /&gt;
&lt;BR /&gt;
      '* Create a selection set&lt;BR /&gt;
      Set objSelectionSet = objSelectionSets.Add("DrawingTitleBlock")&lt;BR /&gt;
      objSelectionSet.Select acSelectionSetAll, , , intSelectionSetType, &lt;BR /&gt;
objSelectionSetData&lt;BR /&gt;
&lt;BR /&gt;
      '* Check to ensure the selection set is not null&lt;BR /&gt;
      If objSelectionSet.Count &amp;gt; 0 Then&lt;BR /&gt;
&lt;BR /&gt;
         For lngSelectionSetCounter = 0 To objSelectionSet.Count&lt;BR /&gt;
&lt;BR /&gt;
            Set objBlockReference = objSelectionSet.Item(0)&lt;BR /&gt;
&lt;BR /&gt;
            If objBlockReference.HasAttributes Then&lt;BR /&gt;
&lt;BR /&gt;
               Set objAttributes = objBlockReference.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
               For lngAttributesCounter = LBound(objAttributes) To &lt;BR /&gt;
UBound(objAttributes)&lt;BR /&gt;
&lt;BR /&gt;
                        Select Case &lt;BR /&gt;
objAttributes(lngAttributesCounter).TagString&lt;BR /&gt;
                           Case "CP_TDWG"&lt;BR /&gt;
                              strTitleBlock(0) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CP_TJNO"&lt;BR /&gt;
                              strTitleBlock(1) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CP_TREV"&lt;BR /&gt;
                              strTitleBlock(2) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CP_TACD"&lt;BR /&gt;
                              strTitleBlock(3) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CP_TPNO"&lt;BR /&gt;
                              strTitleBlock(4) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CP_TSNO"&lt;BR /&gt;
                              strTitleBlock(5) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "DRAW"&lt;BR /&gt;
                              strTitleBlock(6) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "DRAW_DATE"&lt;BR /&gt;
                              strTitleBlock(7) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CHECK"&lt;BR /&gt;
                              strTitleBlock(8) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case "CHECK_DATE"&lt;BR /&gt;
                              strTitleBlock(9) = &lt;BR /&gt;
objAttributes(lngAttributesCounter).TextString&lt;BR /&gt;
                           Case Else&lt;BR /&gt;
                              '* Should not occur&lt;BR /&gt;
                        End Select&lt;BR /&gt;
&lt;BR /&gt;
               Next&lt;BR /&gt;
&lt;BR /&gt;
               Set objAttributes = Nothing&lt;BR /&gt;
&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            Set objBlockReference = Nothing&lt;BR /&gt;
         Next&lt;BR /&gt;
      End If&lt;BR /&gt;
&lt;BR /&gt;
      objSelectionSet.Delete&lt;BR /&gt;
      Set objSelectionSet = Nothing&lt;BR /&gt;
&lt;BR /&gt;
ExitSub:&lt;BR /&gt;
   Exit Sub&lt;BR /&gt;
&lt;BR /&gt;
ErrorHandler:&lt;BR /&gt;
   MsgBox "Error " &amp;amp; Err.Number &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; Err.Description&lt;BR /&gt;
   Resume ExitSub&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Thu, 19 Jan 2006 01:17:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534866#M37483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-19T01:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error '13' Type mismatch on GetAttributes Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534867#M37484</link>
      <description>Assigning objects to a Variant type Variable don't need a Set .....all you &lt;BR /&gt;
need is:&lt;BR /&gt;
&lt;BR /&gt;
objAttributes = objBlockReference.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
"Dustin Wilson" &lt;DWILSON&gt; wrote in message &lt;BR /&gt;
news:5063247@discussion.autodesk.com...&lt;BR /&gt;
I have a small script that will extract the attributes from a block but I&lt;BR /&gt;
get a Runtime Error '13' - Type Mismatch when I get to the line:&lt;BR /&gt;
&lt;BR /&gt;
Set objAttributes = objBlockReference.GetAttributes&lt;/DWILSON&gt;</description>
      <pubDate>Thu, 19 Jan 2006 02:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534867#M37484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-19T02:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error '13' Type mismatch on GetAttributes Method</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534868#M37485</link>
      <description>Jeff&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the insight as I did not realize this.  It seems like such a &lt;BR /&gt;
small thing but had me stumped. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Dustin&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jeff Mishler" &lt;MIFFATSONICDOTNETIS_ALL&gt; wrote in message &lt;BR /&gt;
news:5063306@discussion.autodesk.com...&lt;BR /&gt;
Assigning objects to a Variant type Variable don't need a Set .....all you&lt;BR /&gt;
need is:&lt;BR /&gt;
&lt;BR /&gt;
objAttributes = objBlockReference.GetAttributes&lt;BR /&gt;
&lt;BR /&gt;
"Dustin Wilson" &lt;DWILSON&gt; wrote in message&lt;BR /&gt;
news:5063247@discussion.autodesk.com...&lt;BR /&gt;
I have a small script that will extract the attributes from a block but I&lt;BR /&gt;
get a Runtime Error '13' - Type Mismatch when I get to the line:&lt;BR /&gt;
&lt;BR /&gt;
Set objAttributes = objBlockReference.GetAttributes&lt;/DWILSON&gt;&lt;/MIFFATSONICDOTNETIS_ALL&gt;</description>
      <pubDate>Thu, 19 Jan 2006 12:38:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-13-type-mismatch-on-getattributes-method/m-p/1534868#M37485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-19T12:38:03Z</dc:date>
    </item>
  </channel>
</rss>

