<?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 functionality lost between QV 8.5 and 10 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191982#M501238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the process of upgrading from 8.5 to 10. An existing macro (in 8.5) which rebuilds a pivot table by adding/removing dimensions and enabling/disabling expressions, based on two list boxes populated by an inline load, has worked fine. Now, in 10, the macro fails, resulting in one of two errors; 1) Allocated memory exceeded, and 2) the pivot table grayed out with the diagonal lines stretching from corner to corner. &lt;I&gt;&lt;B&gt;Upon checking the properties of the pivot table after the macro has run (activated by a button via Run Macro), the dimensions and expressions both exhibit the correct characteristics as modified by the macro, and then, without altering anything, upon selecting OK in the properties dialogue box, the pivot table proceeds to refresh and display correctly.&lt;/B&gt;&lt;/I&gt; The macro is included below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas as to why this might be? Maybe i need to refresh the chart in a new way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub rebuild()&lt;BR /&gt; set vAllowCalc = ActiveDocument.Variables("vAllowCalc")&lt;BR /&gt; vAllowCalc.SetContent 0, true 'Display the "Please wait..." text object&lt;BR /&gt; ActiveDocument.GetApplication.WaitForIdle 'wait for QlikView to finish before modifying report&lt;BR /&gt; set selectedExpressions = ActiveDocument.getField("Expr").getSelectedValues&lt;BR /&gt; set selectedDimensions = ActiveDocument.getField("DimField").getSelectedValues&lt;BR /&gt;&lt;BR /&gt; CollapseCht&lt;BR /&gt;&lt;BR /&gt; selectedExpressionMax = selectedExpressions.Count - 1&lt;BR /&gt; selectedDimensionMax = selectedDimensions.Count - 1&lt;BR /&gt; if selectedExpressionMax + selectedDimensionMax &amp;gt; -2 then 'bypass if nothing is selected&lt;BR /&gt;'--------------------------- TABLE BOX ONLY? ---------------------------------------------------&lt;BR /&gt; if selectedExpressionMax = -1 then&lt;BR /&gt; set table = ActiveDocument.getSheetObject("TB01")&lt;BR /&gt; tableDimensionMax = table.GetColumnCount - 1&lt;BR /&gt; for i = tableDimensionMax to 0 step -1 'remove existing dimensions&lt;BR /&gt; table.removeField(i)&lt;BR /&gt; next&lt;BR /&gt; for j = 0 to selectedDimensionMax 'add selected dimensions&lt;BR /&gt; table.addField(selectedDimensions.Item(j).Text)&lt;BR /&gt; next&lt;BR /&gt;&lt;BR /&gt; else&lt;BR /&gt;'--------------------------- EXPRESSIONS ------------------------------------------------------&lt;BR /&gt; set chart = ActiveDocument.getSheetObject("CH642")&lt;BR /&gt; set chartProperties = chart.GetProperties&lt;BR /&gt; set chartExpressions = chartProperties.Expressions&lt;BR /&gt; chartExpressionMax = chartExpressions.Count - 1&lt;BR /&gt; dim selectedExpression(100) 'runs slightly faster if first set up a simple array&lt;BR /&gt; for j = 0 to selectedExpressionMax&lt;BR /&gt; selectedExpression(j) = selectedExpressions.Item(j).Text&lt;BR /&gt; next&lt;BR /&gt; for i = 0 to chartExpressionMax 'for every possible expression defined to the chart&lt;BR /&gt; chartExpression = chartExpressions.Item(i).Item(0).Data.ExpressionVisual.Label.v&lt;BR /&gt; expression = chartExpressions.Item(i).Item(0).Data.ExpressionData&lt;BR /&gt; expression.Enable = false 'disable the expression&lt;BR /&gt; for j = 0 to selectedExpressionMax 'check all selected expressions&lt;BR /&gt; if selectedExpression(j) = chartExpression then 'if user selected the expression&lt;BR /&gt; expression.Enable = true 'enable it&lt;BR /&gt; j = 9999 'and exit the inner loop&lt;BR /&gt; end if&lt;BR /&gt; next&lt;BR /&gt; next&lt;BR /&gt; ActiveDocument.GetApplication.WaitForIdle&lt;BR /&gt; chart.SetProperties chartProperties&lt;BR /&gt;'--------------------------- DIMENSIONS --------------------------------------------------------&lt;BR /&gt; set vDimCnt = ActiveDocument.Variables("vChtDimCnt")&lt;BR /&gt; vDimCnt2 = vDimCnt.GetContent.String&lt;BR /&gt; chartDimensionMax = vDimCnt2&lt;BR /&gt; for i = chartDimensionMax to 0 step -1 'remove existing dimensions&lt;BR /&gt; chart.removeDimension(i)&lt;BR /&gt; next&lt;BR /&gt; for j = 0 to selectedDimensionMax 'add selected dimensions&lt;BR /&gt; chart.addDimension(selectedDimensions.Item(j).Text)&lt;BR /&gt; next&lt;BR /&gt; end if&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Variables("vChtDimCnt").SetContent selectedDimensionMax,true&lt;BR /&gt; vAllowCalc.SetContent 1, true 'allow dynamic report to recalculate&lt;BR /&gt; ActiveDocument.Variables("vRefrPrompt").SetContent "0",true&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 23:37:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-17T23:37:21Z</dc:date>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191982#M501238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the process of upgrading from 8.5 to 10. An existing macro (in 8.5) which rebuilds a pivot table by adding/removing dimensions and enabling/disabling expressions, based on two list boxes populated by an inline load, has worked fine. Now, in 10, the macro fails, resulting in one of two errors; 1) Allocated memory exceeded, and 2) the pivot table grayed out with the diagonal lines stretching from corner to corner. &lt;I&gt;&lt;B&gt;Upon checking the properties of the pivot table after the macro has run (activated by a button via Run Macro), the dimensions and expressions both exhibit the correct characteristics as modified by the macro, and then, without altering anything, upon selecting OK in the properties dialogue box, the pivot table proceeds to refresh and display correctly.&lt;/B&gt;&lt;/I&gt; The macro is included below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas as to why this might be? Maybe i need to refresh the chart in a new way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub rebuild()&lt;BR /&gt; set vAllowCalc = ActiveDocument.Variables("vAllowCalc")&lt;BR /&gt; vAllowCalc.SetContent 0, true 'Display the "Please wait..." text object&lt;BR /&gt; ActiveDocument.GetApplication.WaitForIdle 'wait for QlikView to finish before modifying report&lt;BR /&gt; set selectedExpressions = ActiveDocument.getField("Expr").getSelectedValues&lt;BR /&gt; set selectedDimensions = ActiveDocument.getField("DimField").getSelectedValues&lt;BR /&gt;&lt;BR /&gt; CollapseCht&lt;BR /&gt;&lt;BR /&gt; selectedExpressionMax = selectedExpressions.Count - 1&lt;BR /&gt; selectedDimensionMax = selectedDimensions.Count - 1&lt;BR /&gt; if selectedExpressionMax + selectedDimensionMax &amp;gt; -2 then 'bypass if nothing is selected&lt;BR /&gt;'--------------------------- TABLE BOX ONLY? ---------------------------------------------------&lt;BR /&gt; if selectedExpressionMax = -1 then&lt;BR /&gt; set table = ActiveDocument.getSheetObject("TB01")&lt;BR /&gt; tableDimensionMax = table.GetColumnCount - 1&lt;BR /&gt; for i = tableDimensionMax to 0 step -1 'remove existing dimensions&lt;BR /&gt; table.removeField(i)&lt;BR /&gt; next&lt;BR /&gt; for j = 0 to selectedDimensionMax 'add selected dimensions&lt;BR /&gt; table.addField(selectedDimensions.Item(j).Text)&lt;BR /&gt; next&lt;BR /&gt;&lt;BR /&gt; else&lt;BR /&gt;'--------------------------- EXPRESSIONS ------------------------------------------------------&lt;BR /&gt; set chart = ActiveDocument.getSheetObject("CH642")&lt;BR /&gt; set chartProperties = chart.GetProperties&lt;BR /&gt; set chartExpressions = chartProperties.Expressions&lt;BR /&gt; chartExpressionMax = chartExpressions.Count - 1&lt;BR /&gt; dim selectedExpression(100) 'runs slightly faster if first set up a simple array&lt;BR /&gt; for j = 0 to selectedExpressionMax&lt;BR /&gt; selectedExpression(j) = selectedExpressions.Item(j).Text&lt;BR /&gt; next&lt;BR /&gt; for i = 0 to chartExpressionMax 'for every possible expression defined to the chart&lt;BR /&gt; chartExpression = chartExpressions.Item(i).Item(0).Data.ExpressionVisual.Label.v&lt;BR /&gt; expression = chartExpressions.Item(i).Item(0).Data.ExpressionData&lt;BR /&gt; expression.Enable = false 'disable the expression&lt;BR /&gt; for j = 0 to selectedExpressionMax 'check all selected expressions&lt;BR /&gt; if selectedExpression(j) = chartExpression then 'if user selected the expression&lt;BR /&gt; expression.Enable = true 'enable it&lt;BR /&gt; j = 9999 'and exit the inner loop&lt;BR /&gt; end if&lt;BR /&gt; next&lt;BR /&gt; next&lt;BR /&gt; ActiveDocument.GetApplication.WaitForIdle&lt;BR /&gt; chart.SetProperties chartProperties&lt;BR /&gt;'--------------------------- DIMENSIONS --------------------------------------------------------&lt;BR /&gt; set vDimCnt = ActiveDocument.Variables("vChtDimCnt")&lt;BR /&gt; vDimCnt2 = vDimCnt.GetContent.String&lt;BR /&gt; chartDimensionMax = vDimCnt2&lt;BR /&gt; for i = chartDimensionMax to 0 step -1 'remove existing dimensions&lt;BR /&gt; chart.removeDimension(i)&lt;BR /&gt; next&lt;BR /&gt; for j = 0 to selectedDimensionMax 'add selected dimensions&lt;BR /&gt; chart.addDimension(selectedDimensions.Item(j).Text)&lt;BR /&gt; next&lt;BR /&gt; end if&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.Variables("vChtDimCnt").SetContent selectedDimensionMax,true&lt;BR /&gt; vAllowCalc.SetContent 1, true 'allow dynamic report to recalculate&lt;BR /&gt; ActiveDocument.Variables("vRefrPrompt").SetContent "0",true&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 23:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191982#M501238</guid>
      <dc:creator />
      <dc:date>2010-11-17T23:37:21Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191983#M501239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One last shot here.... Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 16:26:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191983#M501239</guid>
      <dc:creator />
      <dc:date>2010-11-18T16:26:03Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191984#M501241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One last shot here... Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 16:28:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191984#M501241</guid>
      <dc:creator />
      <dc:date>2010-11-18T16:28:50Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191985#M501244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have same problem the addfield get the tablebox graxed with a cross.&lt;/P&gt;&lt;P&gt;Have you found a solution&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 17:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191985#M501244</guid>
      <dc:creator>jp_golay</dc:creator>
      <dc:date>2011-01-18T17:14:10Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191986#M501246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I called the Expand/Collapse function we already had coded, I just called them again as a part of the other macro at the end...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ExpandCht&lt;BR /&gt; set chart = ActiveDocument.getSheetObject("CH642")&lt;BR /&gt; set gp = chart.GetProperties&lt;BR /&gt; gp.TableProperties.PivotAlwaysFullyExpanded = true&lt;BR /&gt; chart.SetProperties gp&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;Sub CollapseCht&lt;BR /&gt; set chart = ActiveDocument.getSheetObject("CH642")&lt;BR /&gt; set gp = chart.GetProperties&lt;BR /&gt; gp.TableProperties.PivotAlwaysFullyExpanded = false&lt;BR /&gt; chart.SetProperties gp&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that make sense...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 00:17:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191986#M501246</guid>
      <dc:creator />
      <dc:date>2011-01-19T00:17:25Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191987#M501248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;Do you have resolution for this yet ? I have the same problem.&lt;/P&gt;&lt;P&gt;And adding the expand sub macro in the original macro still does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 16:17:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191987#M501248</guid>
      <dc:creator />
      <dc:date>2011-01-20T16:17:18Z</dc:date>
    </item>
    <item>
      <title>Macro functionality lost between QV 8.5 and 10</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191988#M501250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beyond the Expand/Collapse macro calls, I have no other solutions. The macros fixed my problems so I stopped troubleshooting. Sorry I can't be of more help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 16:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-functionality-lost-between-QV-8-5-and-10/m-p/191988#M501250</guid>
      <dc:creator />
      <dc:date>2011-01-20T16:29:28Z</dc:date>
    </item>
  </channel>
</rss>

