<?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 Macro If Using Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-If-Using-Variable/m-p/367085#M703035</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a Macro recently which checks the row count of an object and if it is &amp;lt; 500 will export the data to Excel. Otherwise, it will present a message that the row count is too high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to change this to use variables instead of having the max row count hard coded and I'm having difficultly getting this to work. I currently have a variable called "vMaxRowCount" with a value of 500. In my aforementioned Macro I have the following line:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vRowCount"&lt;/SPAN&gt;).SetContent CellRect.Height,&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;true &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;So this stores the value of the row count of the object in the variable "vRowCount". I'd like to now change this line:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #000000;"&gt;Current: &lt;/SPAN&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt; CellRect.Height &amp;gt; 500 &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;Then &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;Desired:&lt;/STRONG&gt; &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vRowCount"&lt;/SPAN&gt;) &amp;gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vMaxRowCount"&lt;/SPAN&gt;) &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;Then &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;The "Desired" line does not work. I get the error "Object doesn't support this property or method". Can I use variables in a Macro in this way? Any feedback is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2012 12:43:27 GMT</pubDate>
    <dc:creator>jcampbell</dc:creator>
    <dc:date>2012-07-25T12:43:27Z</dc:date>
    <item>
      <title>Macro If Using Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-If-Using-Variable/m-p/367085#M703035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a Macro recently which checks the row count of an object and if it is &amp;lt; 500 will export the data to Excel. Otherwise, it will present a message that the row count is too high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to change this to use variables instead of having the max row count hard coded and I'm having difficultly getting this to work. I currently have a variable called "vMaxRowCount" with a value of 500. In my aforementioned Macro I have the following line:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vRowCount"&lt;/SPAN&gt;).SetContent CellRect.Height,&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;true &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;So this stores the value of the row count of the object in the variable "vRowCount". I'd like to now change this line:&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #000000;"&gt;Current: &lt;/SPAN&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt; CellRect.Height &amp;gt; 500 &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;Then &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;Desired:&lt;/STRONG&gt; &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vRowCount"&lt;/SPAN&gt;) &amp;gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vMaxRowCount"&lt;/SPAN&gt;) &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;Then &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;The "Desired" line does not work. I get the error "Object doesn't support this property or method". Can I use variables in a Macro in this way? Any feedback is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 12:43:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-If-Using-Variable/m-p/367085#M703035</guid>
      <dc:creator>jcampbell</dc:creator>
      <dc:date>2012-07-25T12:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro If Using Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-If-Using-Variable/m-p/367086#M703036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vRowCount"&lt;/SPAN&gt;)&lt;STRONG&gt;.GetContent.string&lt;/STRONG&gt; &amp;gt; ActiveDocument.Variables(&lt;SPAN style="color: #1e39f6;"&gt;"vMaxRowCount"&lt;/SPAN&gt;)&lt;STRONG&gt;.GetContent.string&lt;/STRONG&gt; &lt;SPAN style="color: #1e39f6;"&gt;&lt;STRONG&gt;Then &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 17:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-If-Using-Variable/m-p/367086#M703036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-25T17:22:01Z</dc:date>
    </item>
  </channel>
</rss>

