<?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: Loop through multiple listBox selections and export to Excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-through-multiple-listBox-selections-and-export-to-Excel/m-p/232257#M83896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same problem here, can anyone help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 14:24:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-15T14:24:07Z</dc:date>
    <item>
      <title>Loop through multiple listBox selections and export to Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-multiple-listBox-selections-and-export-to-Excel/m-p/232256#M83895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write a macro that will loop through multiple reports per region selection and export each report to excel. I loaded (Inline) the Report Names and corresponding object codes into the application to facilitate, however I cannot seem to get the code to&lt;/P&gt;&lt;P&gt;Loop properly through the various selections:&lt;/P&gt;&lt;P&gt;The first region selected seems to work - I get a tab per each report I selected, but when the code moves to the second region selected it continues to export ALL the reports (regardless of the report name selection).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone point me in the right direction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub vTotal_TestLooping_version3&lt;/P&gt;&lt;P&gt;set doc= ActiveDocument&lt;/P&gt;&lt;P&gt;set docprop = doc.GetProperties&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doc.GetApplication.Refresh&lt;/P&gt;&lt;P&gt;set appExcel = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appExcel.Visible = True&lt;/P&gt;&lt;P&gt;appExcel.WorkBooks.Add()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set RptReg = ActiveDocument.Fields("ReportingRegion").GetPossibleValues&lt;/P&gt;&lt;P&gt;For j=0 to RptReg.Count-1&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ReportingRegion").Select RptReg.Item(j).Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set RptName = ActiveDocument.Fields("ReportName").GetPossibleValues&lt;/P&gt;&lt;P&gt;For i=0 to RptName.Count-1&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ReportName").Select RptName.Item(i).Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set RptObjCode = ActiveDocument.Fields("ObjectCode").GetPossibleValues&lt;/P&gt;&lt;P&gt;For k=0 to RptObjCode.Count-1&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ObjectCode").Select RptObjCode.Item(k).Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set ExportObject = doc.GetSheetObject(RptObjCode.Item(k).Text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appExcel.ActiveSheet.Name = (RptReg.Item(j).Text&amp;amp;" "&amp;amp;RptName.Item(i).Text)&lt;/P&gt;&lt;P&gt;ExportObject.CopyTableToClipboard True&lt;/P&gt;&lt;P&gt;appExcel.ActiveSheet.Paste&lt;/P&gt;&lt;P&gt;appExcel.Sheets.Add&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ObjectCode").Clear&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ReportName").Clear&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ReportingRegion").Clear&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;End sub&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Dec 2010 10:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-multiple-listBox-selections-and-export-to-Excel/m-p/232256#M83895</guid>
      <dc:creator />
      <dc:date>2010-12-24T10:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through multiple listBox selections and export to Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-through-multiple-listBox-selections-and-export-to-Excel/m-p/232257#M83896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same problem here, can anyone help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:24:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-through-multiple-listBox-selections-and-export-to-Excel/m-p/232257#M83896</guid>
      <dc:creator />
      <dc:date>2014-05-15T14:24:07Z</dc:date>
    </item>
  </channel>
</rss>

