<?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 : send to Excel a pivot table with same format in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-send-to-Excel-a-pivot-table-with-same-format/m-p/355695#M132023</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;I am trying to create a button which permits the user to export Data of a pivot table chart directly on Excel, exactly like the "Send to Excel" icon on the caption bar but with the same format of the pivot table in Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the result of this macro would be a merge of the functionnalities "Copy to clipboard" and "Send to Excel".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of my constraint in this macro code is to not use "CreateObject("Excel.Application")" for security reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with the following code, but it doesn't work (only a simple export to Excel) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SUB SendToExcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ID of the pivot table &lt;/P&gt;&lt;P&gt;Set chart = ActiveDocument.GetSheetObject("CH100")&lt;/P&gt;&lt;P&gt;chart.CopyTableToClipboard True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET p = chart.GetProperties&lt;/P&gt;&lt;P&gt;chart.SendToExcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you any ideas ?&lt;/P&gt;&lt;P&gt;&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;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaymerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 08:45:30 GMT</pubDate>
    <dc:creator>jaymerry</dc:creator>
    <dc:date>2012-03-16T08:45:30Z</dc:date>
    <item>
      <title>Macro : send to Excel a pivot table with same format</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-send-to-Excel-a-pivot-table-with-same-format/m-p/355695#M132023</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;I am trying to create a button which permits the user to export Data of a pivot table chart directly on Excel, exactly like the "Send to Excel" icon on the caption bar but with the same format of the pivot table in Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the result of this macro would be a merge of the functionnalities "Copy to clipboard" and "Send to Excel".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of my constraint in this macro code is to not use "CreateObject("Excel.Application")" for security reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with the following code, but it doesn't work (only a simple export to Excel) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SUB SendToExcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ID of the pivot table &lt;/P&gt;&lt;P&gt;Set chart = ActiveDocument.GetSheetObject("CH100")&lt;/P&gt;&lt;P&gt;chart.CopyTableToClipboard True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET p = chart.GetProperties&lt;/P&gt;&lt;P&gt;chart.SendToExcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you any ideas ?&lt;/P&gt;&lt;P&gt;&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;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaymerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 08:45:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-send-to-Excel-a-pivot-table-with-same-format/m-p/355695#M132023</guid>
      <dc:creator>jaymerry</dc:creator>
      <dc:date>2012-03-16T08:45:30Z</dc:date>
    </item>
  </channel>
</rss>

