<?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: An Issue with VBA macro in QV in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444596#M803562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh! You are right, Mathias. It's all about variable state.&lt;/P&gt;&lt;P&gt;Thank you for your explanation and example. It really helps. Everything is clear now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Nov 2017 12:53:05 GMT</pubDate>
    <dc:creator>Peony</dc:creator>
    <dc:date>2017-11-09T12:53:05Z</dc:date>
    <item>
      <title>An Issue with VBA macro in QV</title>
      <link>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444594#M803560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;In attached file I have macro. This macro needs to be used with button "Continue" at the firtst tab. Now, when I push this button it is expected that the second tab will be open and value "4" will be selected in the list box. But instead of it, when I press the button, no value has selected.&lt;/P&gt;&lt;P&gt;There is some mistake in code but I don't get where?&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;




&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;sub select_first&lt;/P&gt;
&lt;P&gt;set vvv_var = ActiveDocument.Variables("v_active_select_first")&lt;/P&gt;
&lt;P&gt;vvv_varcont = vvv_var.GetContent.String&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if vvv_varcont = "1" then&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;vvv_var.SetContent "0", true&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;ActiveDocument.Fields("TOP").Select "4"&lt;/P&gt;
&lt;P&gt;end If&lt;/P&gt;
&lt;P&gt;end sub&lt;/P&gt;




&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; By default: v_active_select_first = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444594#M803560</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: An Issue with VBA macro in QV</title>
      <link>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444595#M803561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nataliia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you don't need to use a macro for this, you can simply add a second action that will select inside the TOP field. &lt;SPAN style="font-size: 10pt;"&gt;I re-attached your app so you can take a look at it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also your macro did not select a value because you check if the content of the variable "v_active_select_first" is set to "1" (it was set to "0"). After manually setting it to "1" (via Variable Overview) your macro works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 12:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444595#M803561</guid>
      <dc:creator>m_s</dc:creator>
      <dc:date>2017-11-09T12:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: An Issue with VBA macro in QV</title>
      <link>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444596#M803562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh! You are right, Mathias. It's all about variable state.&lt;/P&gt;&lt;P&gt;Thank you for your explanation and example. It really helps. Everything is clear now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 12:53:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/An-Issue-with-VBA-macro-in-QV/m-p/1444596#M803562</guid>
      <dc:creator>Peony</dc:creator>
      <dc:date>2017-11-09T12:53:05Z</dc:date>
    </item>
  </channel>
</rss>

