<?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 Hidden sheets - Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232496#M84098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I would like to know how can I walk thru hidden sheets using a macro.&lt;/P&gt;&lt;P&gt;Let me explain better:&lt;/P&gt;&lt;P&gt;I have a template QVW that is used for all of my customers. (we are not using server yet)&lt;/P&gt;&lt;P&gt;Depending on what services my customer buys, I would like to hide some sheets.&lt;BR /&gt;For this, I've created the following macro:&lt;/P&gt;&lt;P&gt;Sub HideSheets&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll true&lt;/P&gt;&lt;P&gt;'Showing all sheets again&lt;BR /&gt; for i = 0 to ActiveDocument.NoOfSheets - 1&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name).Activate&lt;BR /&gt;&lt;BR /&gt; set mysheet = ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)&lt;BR /&gt; set sp=mysheet.GetProperties&lt;BR /&gt; sp.Show.Always = true&lt;BR /&gt; sp.Show.Expression.v = "1=1"&lt;BR /&gt; mysheet.SetProperties sp&lt;BR /&gt;&lt;BR /&gt; next 'i&lt;/P&gt;&lt;P&gt;'Hiding sheets&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll true&lt;BR /&gt;&lt;BR /&gt; set m = ActiveDocument.Variables("v_Servico")&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Fields("Modulo").Select m.GetContent.String&lt;BR /&gt; ActiveDocument.Fields("Modulo").Lock&lt;BR /&gt; ActiveDocument.Fields("AbaVisivel").Select 0&lt;BR /&gt;&lt;BR /&gt; set mySelections = ActiveDocument.Fields("IdAba").GetPossibleValues&lt;/P&gt;&lt;P&gt;for j = 0 to mySelections.Count - 1&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Sheets(mySelections.Item(j).text).Activate&lt;BR /&gt;&lt;BR /&gt; set mysheet = ActiveDocument.Sheets(mySelections.Item(j).text)&lt;BR /&gt; set sp=mysheet.GetProperties&lt;BR /&gt; sp.Show.Always = false&lt;BR /&gt; sp.Show.Expression.v = "1=2"&lt;BR /&gt; mysheet.SetProperties sp&lt;BR /&gt;&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Modulo").UnLock&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.ClearAll true&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;As you can see, the first thing is to show all sheets again. But if there is any hidden sheet, it is not used in the loop "for i = 0 to ActiveDocument.NoOfSheets - 1" because it works with visible sheets only.&lt;/P&gt;&lt;P&gt;Is there a way to loop on all sheets? Even if it's hidden?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2010 14:11:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-02-05T14:11:45Z</dc:date>
    <item>
      <title>Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232496#M84098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I would like to know how can I walk thru hidden sheets using a macro.&lt;/P&gt;&lt;P&gt;Let me explain better:&lt;/P&gt;&lt;P&gt;I have a template QVW that is used for all of my customers. (we are not using server yet)&lt;/P&gt;&lt;P&gt;Depending on what services my customer buys, I would like to hide some sheets.&lt;BR /&gt;For this, I've created the following macro:&lt;/P&gt;&lt;P&gt;Sub HideSheets&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll true&lt;/P&gt;&lt;P&gt;'Showing all sheets again&lt;BR /&gt; for i = 0 to ActiveDocument.NoOfSheets - 1&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name).Activate&lt;BR /&gt;&lt;BR /&gt; set mysheet = ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)&lt;BR /&gt; set sp=mysheet.GetProperties&lt;BR /&gt; sp.Show.Always = true&lt;BR /&gt; sp.Show.Expression.v = "1=1"&lt;BR /&gt; mysheet.SetProperties sp&lt;BR /&gt;&lt;BR /&gt; next 'i&lt;/P&gt;&lt;P&gt;'Hiding sheets&lt;/P&gt;&lt;P&gt;ActiveDocument.ClearAll true&lt;BR /&gt;&lt;BR /&gt; set m = ActiveDocument.Variables("v_Servico")&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Fields("Modulo").Select m.GetContent.String&lt;BR /&gt; ActiveDocument.Fields("Modulo").Lock&lt;BR /&gt; ActiveDocument.Fields("AbaVisivel").Select 0&lt;BR /&gt;&lt;BR /&gt; set mySelections = ActiveDocument.Fields("IdAba").GetPossibleValues&lt;/P&gt;&lt;P&gt;for j = 0 to mySelections.Count - 1&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Sheets(mySelections.Item(j).text).Activate&lt;BR /&gt;&lt;BR /&gt; set mysheet = ActiveDocument.Sheets(mySelections.Item(j).text)&lt;BR /&gt; set sp=mysheet.GetProperties&lt;BR /&gt; sp.Show.Always = false&lt;BR /&gt; sp.Show.Expression.v = "1=2"&lt;BR /&gt; mysheet.SetProperties sp&lt;BR /&gt;&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Modulo").UnLock&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.ClearAll true&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;As you can see, the first thing is to show all sheets again. But if there is any hidden sheet, it is not used in the loop "for i = 0 to ActiveDocument.NoOfSheets - 1" because it works with visible sheets only.&lt;/P&gt;&lt;P&gt;Is there a way to loop on all sheets? Even if it's hidden?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2010 14:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232496#M84098</guid>
      <dc:creator />
      <dc:date>2010-02-05T14:11:45Z</dc:date>
    </item>
    <item>
      <title>Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232497#M84099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this maybe of use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;sub ShowOrHide&lt;BR /&gt; if ActiveDocument.Variables("vShowOptions").GetContent.String &amp;lt;&amp;gt; "0" then&lt;BR /&gt; ActiveDocument.Variables("vShowOptions").SetContent "0",true&lt;BR /&gt; else&lt;BR /&gt; ActiveDocument.Variables("vShowOptions").SetContent "1",true&lt;BR /&gt; end if&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2010 14:48:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232497#M84099</guid>
      <dc:creator />
      <dc:date>2010-02-05T14:48:43Z</dc:date>
    </item>
    <item>
      <title>Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232498#M84100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't see how the other reply helped. Did you find a solution? I have exactly the same question for the same reason!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 10:00:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232498#M84100</guid>
      <dc:creator />
      <dc:date>2010-04-21T10:00:17Z</dc:date>
    </item>
    <item>
      <title>Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232499#M84101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You could use a variable in you show conditions, like this: if(1=1 or showAll = 1, 1, 0)&lt;BR /&gt;Then you could set the variable showAll to 1 first in your macro to show all sheets before looping through them.&lt;/P&gt;&lt;P&gt;Not a perfect solution but it would work&lt;/P&gt;&lt;P&gt;/Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 14:10:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232499#M84101</guid>
      <dc:creator />
      <dc:date>2010-04-21T14:10:58Z</dc:date>
    </item>
    <item>
      <title>Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232500#M84102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I have set up individual variables based on the sheet names and am setting those up in a macro. I hadn't thought of adding a vShowAll variable 0 - that makes it a bit more elegant!&lt;/P&gt;&lt;P&gt;Getting there...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 15:02:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232500#M84102</guid>
      <dc:creator />
      <dc:date>2010-04-21T15:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232501#M84103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I would like&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to share&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;shortcut,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I learned&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;on a topic&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;here,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to display all the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sheets&lt;/SPAN&gt;&lt;SPAN&gt;, whether they&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;are hidden by&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;conditional.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;ctrl&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;+ shift&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;+&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;s&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 19:38:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232501#M84103</guid>
      <dc:creator>michaelfreitas</dc:creator>
      <dc:date>2011-10-06T19:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232502#M84104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created report that need to hide sheet for each Section Access. I'm not sure for this one help all of you or not. So let check my attached how to hide sheet base on user open file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2011 04:05:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232502#M84104</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-08T04:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hidden sheets - Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232503#M84105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Hello&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Sokkorn&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Cheav&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;Actually&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;what i&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;wanted to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;be able to manipulate&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;via&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;macro&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sheets&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;hidden&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;hide them&lt;/SPAN&gt;.&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I found&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a temporary solution&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is to display&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;all the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sheets,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;handle all&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I need,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and hide&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;again.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;By using the shortcut&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;described&lt;/SPAN&gt;.&lt;BR /&gt; &lt;SPAN class="hps"&gt;ctrl&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;+ shift&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;+&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;s&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I am currently&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;using&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;these features&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;through the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;QlikView&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;developer&lt;/SPAN&gt;, not &lt;SPAN class="hps"&gt;the web.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;So&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;no problem&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;displaying&lt;/SPAN&gt;&amp;gt; &lt;SPAN class="hps"&gt;manipulate&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;hide.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Only after this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is that the application&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;goes to the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;web.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;The macro&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is just&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sweep the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;application before being&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;released.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;I appreciate your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;willingness to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;post the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;help file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;Thank you and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;need something&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 14:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hidden-sheets-Macro/m-p/232503#M84105</guid>
      <dc:creator>michaelfreitas</dc:creator>
      <dc:date>2011-10-10T14:37:02Z</dc:date>
    </item>
  </channel>
</rss>

