<?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: Output multiple tables to Excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426820#M159025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the following code in many programs. It should be fairly easy to customize for your use. If you want to do multiple files, just repeat the code, changing the chart identifier CH01 in the following (and of course, creating a unique file name for each subsequent file) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SUB SmartExport&lt;BR /&gt;&lt;BR /&gt;' This module allows the user to export to a specified file name and path from a single button.&lt;BR /&gt;&lt;BR /&gt;' It saves a lot of time compared to hitting the XL export button, and having to save the resulting&lt;BR /&gt;&lt;BR /&gt;' file to a new path and filename.&lt;BR /&gt;&lt;BR /&gt;' &lt;BR /&gt;&lt;BR /&gt;' The macro builds the save file name by getting the month/day figures from the parameters entered by the user. &lt;BR /&gt;&lt;BR /&gt;' It uses the standard prefix 'VGConsBill', followed by start and end dates&lt;BR /&gt;&lt;BR /&gt;'&lt;BR /&gt;&lt;BR /&gt;'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;' Build the date string:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; set m1 = ActiveDocument.Variables("vMonthStart")&lt;BR /&gt;&lt;BR /&gt; ms = m1.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set d1 = ActiveDocument.Variables("vDayStart")&lt;BR /&gt;&lt;BR /&gt; ds = d1.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set m2 = ActiveDocument.Variables("vMonthEnd")&lt;BR /&gt;&lt;BR /&gt;' Have to use "mne" instead of "me" because "me" is a keyword&lt;BR /&gt;&lt;BR /&gt; mne = m2.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set d2 = ActiveDocument.Variables("vDayEnd")&lt;BR /&gt;&lt;BR /&gt; de = d2.GetContent.String&lt;BR /&gt;&lt;BR /&gt;' Now, concatenate all of these to make datestr&lt;BR /&gt;&lt;BR /&gt; datestr = ms &amp;amp; "-" &amp;amp; ds &amp;amp; "-" &amp;amp; mne &amp;amp; "-" &amp;amp; de&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ' Standard name for the report is "VGConsBill-ms-ds-mne-de"&lt;BR /&gt;&lt;BR /&gt; v = "VGConsBill"&lt;BR /&gt;&lt;BR /&gt; ' Create the appropriate filename&lt;BR /&gt;&lt;BR /&gt; FileName = v &amp;amp; datestr &amp;amp; ".xlsx"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;' User has specified the path. Alternately, in the future,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;' Path could picked up from an input box on the sheet where user enters desired path&lt;BR /&gt;&lt;BR /&gt; Path = "S:\Billing Reports\VG\"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ' Prep the Excel application&lt;BR /&gt;&lt;BR /&gt; set XLApp = CreateObject("Excel.Application")&lt;BR /&gt;&lt;BR /&gt; XLApp.Visible = False&lt;BR /&gt;&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; ' CH01 is the table containing the VG billing data&lt;BR /&gt;&lt;BR /&gt; ' CH01 is never more than a one sheet file&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;BR /&gt;&lt;BR /&gt; ' Export the file&lt;BR /&gt;&lt;BR /&gt; XLDoc.Sheets(1).Name = "Export"&lt;BR /&gt;&lt;BR /&gt; XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt;&lt;BR /&gt; XLDoc.Close&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 16:54:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-11T16:54:51Z</dc:date>
    <item>
      <title>Output multiple tables to Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426818#M159023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of our users wants to be able to output several tables into Excel with the push of a button. Has anyone done anything like this? Is there an easy way to set it up?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426818#M159023</guid>
      <dc:creator />
      <dc:date>2012-12-11T15:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple tables to Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426819#M159024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;try&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a button with&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;trigger&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:07:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426819#M159024</guid>
      <dc:creator />
      <dc:date>2012-12-11T15:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple tables to Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426820#M159025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the following code in many programs. It should be fairly easy to customize for your use. If you want to do multiple files, just repeat the code, changing the chart identifier CH01 in the following (and of course, creating a unique file name for each subsequent file) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SUB SmartExport&lt;BR /&gt;&lt;BR /&gt;' This module allows the user to export to a specified file name and path from a single button.&lt;BR /&gt;&lt;BR /&gt;' It saves a lot of time compared to hitting the XL export button, and having to save the resulting&lt;BR /&gt;&lt;BR /&gt;' file to a new path and filename.&lt;BR /&gt;&lt;BR /&gt;' &lt;BR /&gt;&lt;BR /&gt;' The macro builds the save file name by getting the month/day figures from the parameters entered by the user. &lt;BR /&gt;&lt;BR /&gt;' It uses the standard prefix 'VGConsBill', followed by start and end dates&lt;BR /&gt;&lt;BR /&gt;'&lt;BR /&gt;&lt;BR /&gt;'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;' Build the date string:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; set m1 = ActiveDocument.Variables("vMonthStart")&lt;BR /&gt;&lt;BR /&gt; ms = m1.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set d1 = ActiveDocument.Variables("vDayStart")&lt;BR /&gt;&lt;BR /&gt; ds = d1.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set m2 = ActiveDocument.Variables("vMonthEnd")&lt;BR /&gt;&lt;BR /&gt;' Have to use "mne" instead of "me" because "me" is a keyword&lt;BR /&gt;&lt;BR /&gt; mne = m2.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set d2 = ActiveDocument.Variables("vDayEnd")&lt;BR /&gt;&lt;BR /&gt; de = d2.GetContent.String&lt;BR /&gt;&lt;BR /&gt;' Now, concatenate all of these to make datestr&lt;BR /&gt;&lt;BR /&gt; datestr = ms &amp;amp; "-" &amp;amp; ds &amp;amp; "-" &amp;amp; mne &amp;amp; "-" &amp;amp; de&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ' Standard name for the report is "VGConsBill-ms-ds-mne-de"&lt;BR /&gt;&lt;BR /&gt; v = "VGConsBill"&lt;BR /&gt;&lt;BR /&gt; ' Create the appropriate filename&lt;BR /&gt;&lt;BR /&gt; FileName = v &amp;amp; datestr &amp;amp; ".xlsx"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;' User has specified the path. Alternately, in the future,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;' Path could picked up from an input box on the sheet where user enters desired path&lt;BR /&gt;&lt;BR /&gt; Path = "S:\Billing Reports\VG\"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; ' Prep the Excel application&lt;BR /&gt;&lt;BR /&gt; set XLApp = CreateObject("Excel.Application")&lt;BR /&gt;&lt;BR /&gt; XLApp.Visible = False&lt;BR /&gt;&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; ' CH01 is the table containing the VG billing data&lt;BR /&gt;&lt;BR /&gt; ' CH01 is never more than a one sheet file&lt;BR /&gt;&lt;BR /&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;BR /&gt;&lt;BR /&gt; ' Export the file&lt;BR /&gt;&lt;BR /&gt; XLDoc.Sheets(1).Name = "Export"&lt;BR /&gt;&lt;BR /&gt; XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt;&lt;BR /&gt; XLDoc.Close&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 16:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Output-multiple-tables-to-Excel/m-p/426820#M159025</guid>
      <dc:creator />
      <dc:date>2012-12-11T16:54:51Z</dc:date>
    </item>
  </channel>
</rss>

