<?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 Export To Excel - 1 Field / Tab in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-To-Excel-1-Field-Tab/m-p/347432#M706606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have got a table that I need to export to excel splitting it over workbooks by a group.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I've thankfully picked up a bit of code to do this, as below. &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;But, what I also need is to split those worksheet by a sub field by tab and rename the tab appropriately. &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Any ideas? &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Thanks in advance.&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt;sub Export&lt;BR /&gt; &lt;BR /&gt; set f = activedocument.Fields("FE_SUB_GROUP")&lt;BR /&gt; &lt;BR /&gt; if IsEmpty(f.GetSelectedValues) then&lt;BR /&gt; set pv = f.GetSelectedValues 'adds selected values if any&lt;BR /&gt; else&lt;BR /&gt; set pv = f.GetPossibleValues(1000) 'adds possible values if none selected&lt;BR /&gt; end if&lt;BR /&gt; &lt;BR /&gt; set Array1 = f.GetNoValues 'empty array&lt;BR /&gt; for i = 0 to pv.count-1 'adds values from the first array&lt;BR /&gt; Array1.Add&lt;BR /&gt; Array1(i).Text = pv.item(i).Text&lt;BR /&gt; Array1(i).IsNumeric = false 'if text in your field&lt;BR /&gt; next&lt;BR /&gt; &lt;BR /&gt; 'Creates a path and a filename of the output xls-file in the same folder as the current document&lt;BR /&gt; 'Path = ActiveDocument.Evaluate("left(DocumentPath(), index(DocumentPath(), '\', -1))")&lt;BR /&gt; Path = "C:\Team_Audit\" 'your static path if you dont want a dynamic path&lt;BR /&gt; set obj = ActiveDocument.GetSheetObject("CH97") 'the ID of the object you want to export&lt;BR /&gt; &lt;BR /&gt; 'Loop through each selection in your field&lt;BR /&gt; for i = 0 to Array1.count-1&lt;BR /&gt; f.Select Array1(i).Text 'Selects one value in your field at a time&lt;BR /&gt; &lt;BR /&gt; 'Sets the FileName to be the same as the selection in your chosen field&lt;BR /&gt; FileName = Array1(i).Text &amp;amp; ".xls"&lt;BR /&gt; &lt;BR /&gt; ' Starts Excel&lt;BR /&gt; set XLApp = CreateObject("Excel.Application")&lt;BR /&gt; ' Makes it run in background&lt;BR /&gt; XLApp.Visible = False&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt; &lt;BR /&gt; ' Set the cell to start in at A1&lt;BR /&gt; Set rngStart = XLDoc.Sheets(1).Range("A1")&lt;BR /&gt; &lt;BR /&gt; ' Copies the chosen object contents to clipboard&lt;BR /&gt; obj.CopyTableToClipboard true&lt;BR /&gt; ' Paste it into excel&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;BR /&gt; ' Save the excel-file with the dynamic path and filename&lt;BR /&gt; XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt; ' Exits the current running Excel&lt;BR /&gt; XLApp.Quit&lt;BR /&gt; &lt;BR /&gt; next 'goes to the next value in the selection in the chosen field&lt;BR /&gt; &lt;BR /&gt; end sub &lt;/DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Mar 2012 09:53:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-12T09:53:25Z</dc:date>
    <item>
      <title>Export To Excel - 1 Field / Tab</title>
      <link>https://community.qlik.com/t5/QlikView/Export-To-Excel-1-Field-Tab/m-p/347432#M706606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have got a table that I need to export to excel splitting it over workbooks by a group.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I've thankfully picked up a bit of code to do this, as below. &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;But, what I also need is to split those worksheet by a sub field by tab and rename the tab appropriately. &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Any ideas? &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Thanks in advance.&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt;sub Export&lt;BR /&gt; &lt;BR /&gt; set f = activedocument.Fields("FE_SUB_GROUP")&lt;BR /&gt; &lt;BR /&gt; if IsEmpty(f.GetSelectedValues) then&lt;BR /&gt; set pv = f.GetSelectedValues 'adds selected values if any&lt;BR /&gt; else&lt;BR /&gt; set pv = f.GetPossibleValues(1000) 'adds possible values if none selected&lt;BR /&gt; end if&lt;BR /&gt; &lt;BR /&gt; set Array1 = f.GetNoValues 'empty array&lt;BR /&gt; for i = 0 to pv.count-1 'adds values from the first array&lt;BR /&gt; Array1.Add&lt;BR /&gt; Array1(i).Text = pv.item(i).Text&lt;BR /&gt; Array1(i).IsNumeric = false 'if text in your field&lt;BR /&gt; next&lt;BR /&gt; &lt;BR /&gt; 'Creates a path and a filename of the output xls-file in the same folder as the current document&lt;BR /&gt; 'Path = ActiveDocument.Evaluate("left(DocumentPath(), index(DocumentPath(), '\', -1))")&lt;BR /&gt; Path = "C:\Team_Audit\" 'your static path if you dont want a dynamic path&lt;BR /&gt; set obj = ActiveDocument.GetSheetObject("CH97") 'the ID of the object you want to export&lt;BR /&gt; &lt;BR /&gt; 'Loop through each selection in your field&lt;BR /&gt; for i = 0 to Array1.count-1&lt;BR /&gt; f.Select Array1(i).Text 'Selects one value in your field at a time&lt;BR /&gt; &lt;BR /&gt; 'Sets the FileName to be the same as the selection in your chosen field&lt;BR /&gt; FileName = Array1(i).Text &amp;amp; ".xls"&lt;BR /&gt; &lt;BR /&gt; ' Starts Excel&lt;BR /&gt; set XLApp = CreateObject("Excel.Application")&lt;BR /&gt; ' Makes it run in background&lt;BR /&gt; XLApp.Visible = False&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt; &lt;BR /&gt; ' Set the cell to start in at A1&lt;BR /&gt; Set rngStart = XLDoc.Sheets(1).Range("A1")&lt;BR /&gt; &lt;BR /&gt; ' Copies the chosen object contents to clipboard&lt;BR /&gt; obj.CopyTableToClipboard true&lt;BR /&gt; ' Paste it into excel&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;BR /&gt; ' Save the excel-file with the dynamic path and filename&lt;BR /&gt; XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt; ' Exits the current running Excel&lt;BR /&gt; XLApp.Quit&lt;BR /&gt; &lt;BR /&gt; next 'goes to the next value in the selection in the chosen field&lt;BR /&gt; &lt;BR /&gt; end sub &lt;/DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2012 09:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-To-Excel-1-Field-Tab/m-p/347432#M706606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-12T09:53:25Z</dc:date>
    </item>
  </channel>
</rss>

