<?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 Strange macro error - Invalid procedure call or argument ??! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188700#M51860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try displaying hash.key.Count and itemno.Count in msgbox's. They must be exactly equal for your example to work. In which case why not use itemno.Count the limit variable?&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 15:27:57 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2009-12-16T15:27:57Z</dc:date>
    <item>
      <title>Strange macro error - Invalid procedure call or argument ??!</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188699#M51859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;sub&lt;/B&gt; test&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;&lt;/B&gt;set hash_key = ActiveDocument.Fields("trans_hash_key").GetPossibleValues(100000)&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;&lt;/B&gt;set itemno = ActiveDocument.Fields("lime_itemno").GetPossibleValues(100000)&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;&lt;/B&gt;for i = 0 to hash_key.count - 1&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;&lt;/B&gt; msgbox itemno(i).text ' Error here after 5 loops!&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;&lt;/B&gt;next&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;B&gt;end&lt;/B&gt; &lt;B&gt;sub&lt;/B&gt;&lt;/P&gt;&lt;P&gt;loops through my data for about 5 times (there is totaly 10 rows of data to be read), and then suddenly stops with the errormessage Invalid procedure call or argument marking the row &lt;STRONG&gt;msgbox&lt;/STRONG&gt; itemno(i).text&lt;/P&gt;&lt;P&gt;What can be wrong? My first guess was that the data in itemno(5).text was corrupt somehow, but when i selected only this row on this item in qlikview and run the test macro again, the macro runns ok without any errors...it seems like there is some buffer error or such.&lt;/P&gt;&lt;P&gt;Any ideas anyone?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 04:23:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188699#M51859</guid>
      <dc:creator />
      <dc:date>2009-12-16T04:23:50Z</dc:date>
    </item>
    <item>
      <title>Strange macro error - Invalid procedure call or argument ??!</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188700#M51860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try displaying hash.key.Count and itemno.Count in msgbox's. They must be exactly equal for your example to work. In which case why not use itemno.Count the limit variable?&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 15:27:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188700#M51860</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-12-16T15:27:57Z</dc:date>
    </item>
    <item>
      <title>SV:Re: Strange macro error - Invalid procedure call or argument ??!</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188701#M51861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. Let me explain more about this problem:&lt;/P&gt;&lt;P&gt;My example was a simplified example. I actually need to get 4 columns from my table like this:&lt;/P&gt;&lt;P&gt;set hash_key = ActiveDocument.Fields("trans_hash_key").GetPossibleValues(100000)&lt;BR /&gt; set period = ActiveDocument.Fields("trans_period").GetPossibleValues(100000)&lt;BR /&gt; set qty = ActiveDocument.Fields("lime_qty").GetPossibleValues(100000)&lt;BR /&gt; set itemno = ActiveDocument.Fields("lime_itemno").GetPossibleValues(100000)&lt;BR /&gt;&lt;BR /&gt; for i = 0 to hash_key.count - 1&lt;/P&gt;&lt;P&gt;msgbox "hash " + hash_key(i).text&lt;BR /&gt; msgbox "item " + itemno(i).text&lt;BR /&gt; msgbox "period " + period(i).text&lt;BR /&gt; msgbox "qty " + qty(i).text&lt;BR /&gt;&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;This generates the error I was talking about earlier.&lt;/P&gt;&lt;P&gt;If I change the code to this and have itemno as limit variable:&lt;/P&gt;&lt;P&gt;set hash_key = ActiveDocument.Fields("trans_hash_key").GetPossibleValues(100000)&lt;BR /&gt; set period = ActiveDocument.Fields("trans_period").GetPossibleValues(100000)&lt;BR /&gt; set qty = ActiveDocument.Fields("lime_qty").GetPossibleValues(100000)&lt;BR /&gt; set itemno = ActiveDocument.Fields("lime_itemno").GetPossibleValues(100000)&lt;BR /&gt;&lt;BR /&gt; for i = 0 to itemno .count - 1&lt;/P&gt;&lt;P&gt;msgbox "hash " + hash_key(i).text&lt;BR /&gt; msgbox "item " + itemno(i).text&lt;BR /&gt; msgbox "period " + period(i).text&lt;BR /&gt; msgbox "qty " + qty(i).text&lt;BR /&gt;&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;Then I get &lt;STRONG&gt;no errors&lt;/STRONG&gt;, but the data is &lt;STRONG&gt;messed up&lt;/STRONG&gt; like this:&lt;/P&gt;&lt;P&gt;This is an example data&lt;/P&gt;&lt;P&gt;hash_id itemno period qty&lt;BR /&gt;1 A 2 12&lt;BR /&gt;2 B 1 18&lt;/P&gt;&lt;P&gt;Then, my messageboxes from my second code example looks like this:&lt;/P&gt;&lt;P&gt;"hash 1" -&amp;gt; "itemno A" -&amp;gt; "period 1" -&amp;gt; "qty 12"&lt;BR /&gt;"hash 2" -&amp;gt; "itemno B" -&amp;gt; "period 2" -&amp;gt; "qty 18"&lt;/P&gt;&lt;P&gt;Which is wrong. Period is displayed on the wrong itemno. It seems like Qlikview is considering my 4 fields like 4 differnt tables, not linked togeter, and sorted separatly ascending....&lt;/P&gt;&lt;P&gt;/Robert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-macro-error-Invalid-procedure-call-or-argument/m-p/188701#M51861</guid>
      <dc:creator />
      <dc:date>2009-12-16T16:19:06Z</dc:date>
    </item>
  </channel>
</rss>

