<?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: activate a sheet whose id is a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/activate-a-sheet-whose-id-is-a-variable/m-p/339686#M125394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say the variable is named vSheet in the QlikView application. Then the code should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13442524123905946" jivemacro_uid="_13442524123905946"&gt;&lt;P&gt;Set s = ActiveDocument.Variables("vSheet")&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetById(s&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;.GetContent.String&lt;/SPAN&gt;).Activate&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Note that you can use a direct button action instead of a macro to activate a sheet depending on the value of a variable. Better off using this instead of using macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2012 11:23:48 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-08-06T11:23:48Z</dc:date>
    <item>
      <title>activate a sheet whose id is a variable</title>
      <link>https://community.qlik.com/t5/QlikView/activate-a-sheet-whose-id-is-a-variable/m-p/339685#M125393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I need to write a macro in which I want to activate sheets&lt;/P&gt;&lt;P&gt;I know that the syntax is as follows:&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetByID("SH03").Activate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however the SH03 I have it in a variable&lt;/P&gt;&lt;P&gt;Please advise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:18:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/activate-a-sheet-whose-id-is-a-variable/m-p/339685#M125393</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2012-08-06T11:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: activate a sheet whose id is a variable</title>
      <link>https://community.qlik.com/t5/QlikView/activate-a-sheet-whose-id-is-a-variable/m-p/339686#M125394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say the variable is named vSheet in the QlikView application. Then the code should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13442524123905946" jivemacro_uid="_13442524123905946"&gt;&lt;P&gt;Set s = ActiveDocument.Variables("vSheet")&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetById(s&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;.GetContent.String&lt;/SPAN&gt;).Activate&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Note that you can use a direct button action instead of a macro to activate a sheet depending on the value of a variable. Better off using this instead of using macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:23:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/activate-a-sheet-whose-id-is-a-variable/m-p/339686#M125394</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-08-06T11:23:48Z</dc:date>
    </item>
  </channel>
</rss>

