<?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 Pivot table only exports one column from macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-table-only-exports-one-column-from-macro/m-p/395407#M147456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a pivot table which normally shows anywhere from 5 to 30 columns, depending on how many calls a rep has made that day (1 column per call).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a macro to do this automatically, but when I run the macro, only the first column shows up. If I click on the "Export to Excel" icon on the chart in QV, it exports to Excel just fine. Here's my macro code:&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 MakeExcelFile&lt;BR /&gt;' This sub opens an Excel template, copies the chart over, reformats the Excel&lt;BR /&gt;' file using a macro, and then saves the file to a unique file name.&lt;BR /&gt;&lt;BR /&gt;' First, copy the chart&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt;'Create the save file name&lt;BR /&gt;&lt;BR /&gt;set s1 = ActiveDocument.Variables("vCurRep")&lt;BR /&gt;set s2 = ActiveDocument.Variables("vCallDate")&lt;BR /&gt;f1 = s1.GetContent.String&lt;BR /&gt;f2 = s2.GetContent.String&lt;BR /&gt;Path = "S:\ADMIN\USERS\KBER\Boomerang\"&lt;BR /&gt;&lt;BR /&gt;' Next, open Excel and then open the template file&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.Open("S:\ADMIN\USERS\KBER\Boomerang\DCSTemplate.xlsm", 0, True)&lt;BR /&gt;&lt;BR /&gt;' Paste the chart on Sheet1&lt;BR /&gt;&lt;BR /&gt;XLDOC.Sheets(1).Paste()&lt;BR /&gt;&lt;BR /&gt;' Run the macros&lt;BR /&gt;&lt;BR /&gt;XLApp.Run&amp;nbsp; "DailyCallSummaryFormat"&lt;BR /&gt;XLApp.Run "CreateThePrintArea"&lt;BR /&gt;&lt;BR /&gt;' Save the file&lt;BR /&gt;&lt;BR /&gt;XLDOC.SaveAs Path &amp;amp; f1 &amp;amp; f2&lt;BR /&gt;XLDOC.Close&lt;BR /&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas why the entire table is not being copied?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 21:54:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-28T21:54:47Z</dc:date>
    <item>
      <title>Pivot table only exports one column from macro</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-table-only-exports-one-column-from-macro/m-p/395407#M147456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a pivot table which normally shows anywhere from 5 to 30 columns, depending on how many calls a rep has made that day (1 column per call).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a macro to do this automatically, but when I run the macro, only the first column shows up. If I click on the "Export to Excel" icon on the chart in QV, it exports to Excel just fine. Here's my macro code:&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 MakeExcelFile&lt;BR /&gt;' This sub opens an Excel template, copies the chart over, reformats the Excel&lt;BR /&gt;' file using a macro, and then saves the file to a unique file name.&lt;BR /&gt;&lt;BR /&gt;' First, copy the chart&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt;'Create the save file name&lt;BR /&gt;&lt;BR /&gt;set s1 = ActiveDocument.Variables("vCurRep")&lt;BR /&gt;set s2 = ActiveDocument.Variables("vCallDate")&lt;BR /&gt;f1 = s1.GetContent.String&lt;BR /&gt;f2 = s2.GetContent.String&lt;BR /&gt;Path = "S:\ADMIN\USERS\KBER\Boomerang\"&lt;BR /&gt;&lt;BR /&gt;' Next, open Excel and then open the template file&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.Open("S:\ADMIN\USERS\KBER\Boomerang\DCSTemplate.xlsm", 0, True)&lt;BR /&gt;&lt;BR /&gt;' Paste the chart on Sheet1&lt;BR /&gt;&lt;BR /&gt;XLDOC.Sheets(1).Paste()&lt;BR /&gt;&lt;BR /&gt;' Run the macros&lt;BR /&gt;&lt;BR /&gt;XLApp.Run&amp;nbsp; "DailyCallSummaryFormat"&lt;BR /&gt;XLApp.Run "CreateThePrintArea"&lt;BR /&gt;&lt;BR /&gt;' Save the file&lt;BR /&gt;&lt;BR /&gt;XLDOC.SaveAs Path &amp;amp; f1 &amp;amp; f2&lt;BR /&gt;XLDOC.Close&lt;BR /&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas why the entire table is not being copied?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 21:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-table-only-exports-one-column-from-macro/m-p/395407#M147456</guid>
      <dc:creator />
      <dc:date>2013-02-28T21:54:47Z</dc:date>
    </item>
  </channel>
</rss>

