<?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: Problem With Variant in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246620#M46252</link>
    <description>You have an array of variants, which is the data being returned [that's the meaning of the 8204 number].

Then you have a loop that says for every variant in that array, print it to debug window displaying that that variant's value is a string.
  "TomD" &lt;TDIVITTIS.NO&gt; wrote in message news:420ce7c8$1_3@newsprd01...
  I'm at a loss to explain how the following piece of code could result in what it is generating.  If anyone could offer any comment, I would appreciate it.

  Dim vTmp As Variant
    Debug.Print " VarType(vRetLst): " &amp;amp; VarType(vRetLst)
    Debug.Print "  Bounds: " &amp;amp; LBound(vRetLst) &amp;amp; " -&amp;gt; " &amp;amp; UBound(vRetLst)
    For Each vTmp In vRetLst
      Debug.Print vTmp
    Next vTmp

  Result, in the Immediate Window:

   VarType(vRetLst): 8204
    Bounds: 0 -&amp;gt; 0
  3DP   type: 8
  DRA   type: 8
  ENS   type: 8
  PAV   type: 8
  PRF   type: 8
  PRP   type: 8
  STR   type: 8
  SWM   type: 8
  TOP   type: 8
  UTL   type: 8

  I'm trying to populate a combobox with the strings being shown here, but they are not making it.  While trying to check them out, I saw this and am wondering how the For Each could be looping that many times through a variant array containing only one item (according to the LBound and UBound).

  vRetLst is the result of an ADO RecordSet.GetRows, for what that may be worth.

  I got around this problem by using the For Each, but was hoping to understand this better.  I won't understand why I used the For Each here, because I wouldn't normally do so with a variant array of strings.&lt;/TDIVITTIS.NO&gt;</description>
    <pubDate>Fri, 11 Feb 2005 18:36:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-02-11T18:36:15Z</dc:date>
    <item>
      <title>Problem With Variant</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246618#M46250</link>
      <description>I'm at a loss to explain how the following piece of code could result in what it is generating.  If anyone could offer any comment, I would appreciate it.

Dim vTmp As Variant
  Debug.Print " VarType(vRetLst): " &amp;amp; VarType(vRetLst)
  Debug.Print "  Bounds: " &amp;amp; LBound(vRetLst) &amp;amp; " -&amp;gt; " &amp;amp; UBound(vRetLst)
  For Each vTmp In vRetLst
    Debug.Print vTmp
  Next vTmp

Result, in the Immediate Window:

 VarType(vRetLst): 8204
  Bounds: 0 -&amp;gt; 0
3DP   type: 8
DRA   type: 8
ENS   type: 8
PAV   type: 8
PRF   type: 8
PRP   type: 8
STR   type: 8
SWM   type: 8
TOP   type: 8
UTL   type: 8

I'm trying to populate a combobox with the strings being shown here, but they are not making it.  While trying to check them out, I saw this and am wondering how the For Each could be looping that many times through a variant array containing only one item (according to the LBound and UBound).

vRetLst is the result of an ADO RecordSet.GetRows, for what that may be worth.

I got around this problem by using the For Each, but was hoping to understand this better.  I won't understand why I used the For Each here, because I wouldn't normally do so with a variant array of strings.</description>
      <pubDate>Fri, 11 Feb 2005 17:13:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246618#M46250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-11T17:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Variant</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246619#M46251</link>
      <description>Check the documentation for the .GetRows  method for the returned type.  Also that for the LBound and UBound functions for the optional second argument.</description>
      <pubDate>Fri, 11 Feb 2005 17:53:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246619#M46251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-11T17:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Variant</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246620#M46252</link>
      <description>You have an array of variants, which is the data being returned [that's the meaning of the 8204 number].

Then you have a loop that says for every variant in that array, print it to debug window displaying that that variant's value is a string.
  "TomD" &lt;TDIVITTIS.NO&gt; wrote in message news:420ce7c8$1_3@newsprd01...
  I'm at a loss to explain how the following piece of code could result in what it is generating.  If anyone could offer any comment, I would appreciate it.

  Dim vTmp As Variant
    Debug.Print " VarType(vRetLst): " &amp;amp; VarType(vRetLst)
    Debug.Print "  Bounds: " &amp;amp; LBound(vRetLst) &amp;amp; " -&amp;gt; " &amp;amp; UBound(vRetLst)
    For Each vTmp In vRetLst
      Debug.Print vTmp
    Next vTmp

  Result, in the Immediate Window:

   VarType(vRetLst): 8204
    Bounds: 0 -&amp;gt; 0
  3DP   type: 8
  DRA   type: 8
  ENS   type: 8
  PAV   type: 8
  PRF   type: 8
  PRP   type: 8
  STR   type: 8
  SWM   type: 8
  TOP   type: 8
  UTL   type: 8

  I'm trying to populate a combobox with the strings being shown here, but they are not making it.  While trying to check them out, I saw this and am wondering how the For Each could be looping that many times through a variant array containing only one item (according to the LBound and UBound).

  vRetLst is the result of an ADO RecordSet.GetRows, for what that may be worth.

  I got around this problem by using the For Each, but was hoping to understand this better.  I won't understand why I used the For Each here, because I wouldn't normally do so with a variant array of strings.&lt;/TDIVITTIS.NO&gt;</description>
      <pubDate>Fri, 11 Feb 2005 18:36:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246620#M46252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-11T18:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Variant</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246621#M46253</link>
      <description>"fantum" &lt;NOSPAM&gt; wrote in message 
news:9032171.1108144459532.JavaMail.jive@jiveforum2.autodesk.com...
&amp;gt; Check the documentation for the .GetRows  method for the returned type. 
&amp;gt; Also that for the LBound and UBound functions for the optional second 
&amp;gt; argument.

Between the answers from you and VBA, it has all become quite clear (and 
obvious, in hindsight.)

Thank you, very much.&lt;/NOSPAM&gt;</description>
      <pubDate>Mon, 14 Feb 2005 14:25:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246621#M46253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-14T14:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Variant</title>
      <link>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246622#M46254</link>
      <description>Between the answers from you and fantum, it has all become quite clear (and obvious, in hindsight.)

Thank you, very much.

"VBA" &lt;NOSPAM&gt; wrote in message news:420cfb26$1_1@newsprd01...
  You have an array of variants, which is the data being returned [that's the meaning of the 8204 number].

  Then you have a loop that says for every variant in that array, print it to debug window displaying that that variant's value is a string.&lt;/NOSPAM&gt;</description>
      <pubDate>Mon, 14 Feb 2005 14:25:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/problem-with-variant/m-p/1246622#M46254</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-02-14T14:25:50Z</dc:date>
    </item>
  </channel>
</rss>

