<?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 - paste table in Excel and match formatting destination in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5480#M900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple macro where I simply copy and paste some tables from Qlikview to Excel. Basically, it is working well, but I need the exported table to match the destination formatting in Excel. The reason is that when I perform some heavy calculations in the Excel file, it becomes too heavy for Excel when I keep the source formatting.and I cannot use the Excel file. However, when I manually posted the from Qlikview to Excel and used match formatting destination it worked much better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how the macro looks now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Export_excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; XLApp.Visible = true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLDoc = XLApp.Workbooks.Open("H:\My Documents\Test.xlsx")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(1)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB11").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(1).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(2)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB05").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(2).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(3)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB06").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(3).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(4)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB09").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(4).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jan 2018 15:26:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-23T15:26:05Z</dc:date>
    <item>
      <title>Macro - paste table in Excel and match formatting destination</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5480#M900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple macro where I simply copy and paste some tables from Qlikview to Excel. Basically, it is working well, but I need the exported table to match the destination formatting in Excel. The reason is that when I perform some heavy calculations in the Excel file, it becomes too heavy for Excel when I keep the source formatting.and I cannot use the Excel file. However, when I manually posted the from Qlikview to Excel and used match formatting destination it worked much better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how the macro looks now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Export_excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; XLApp.Visible = true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set XLDoc = XLApp.Workbooks.Open("H:\My Documents\Test.xlsx")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(1)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB11").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(1).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(2)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB05").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(2).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(3)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB06").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(3).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Export = XLDoc.Worksheets(4)&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB09").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(4).Activate &lt;/P&gt;&lt;P&gt;Export.Paste Export.Range("A1")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 15:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5480#M900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-23T15:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro - paste table in Excel and match formatting destination</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5481#M901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look on the &lt;A href="https://msdn.microsoft.com/de-de/vba/excel-vba/articles/range-pastespecial-method-excel" title="https://msdn.microsoft.com/de-de/vba/excel-vba/articles/range-pastespecial-method-excel"&gt;range-pastespecial-method&lt;/A&gt;‌.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 15:49:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5481#M901</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-01-23T15:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro - paste table in Excel and match formatting destination</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5482#M902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but I really can't wrap my head around it. It's been quite some time since I worked with VBA, but it just does not want to paste in any other way regardless which combination I tried. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am leaning more towards pasting it, copying from Excel and pasting it once more but with values or similar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 09:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5482#M902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-24T09:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macro - paste table in Excel and match formatting destination</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5483#M903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if you are looking for pastespecial within the vba-foren you will find various examples how it worked and also for a reversed approach of removing all formattings after pasting the content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another try could be to remove all formattings from the tableboxes respectively to adjust them with the target-formattings (you might need to switch them to straight-tables for this). An alternatively could be just to export the data into csv-files and using them as an external data-sources in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside them you could transfer some of the heay calculations to Qlik and/or optimizing your excel-calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 10:26:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5483#M903</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-01-24T10:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro - paste table in Excel and match formatting destination</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5484#M904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually did some more searching in a bit wider area (I have done a lot of googling), and I think I came up with a solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not use destination formatting as was planned, but rather text. I think this will work.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Now it looks like this (partially renamed):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB SendExcel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set XLApp = CreateObject("Excel.Application") &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLApp.Visible = True &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set XLDoc = XLApp.Workbooks.Add &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB11").CopyTextToClipboard&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDoc.Sheets(1).Range("A1").Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With XLDoc.Sheets(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Range("A1").PasteSpecial _&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Operation=xlPasteSpecialOperationAdd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TB05").CopyTextToClipboard&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLDoc.Sheets(2).Activate &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XLDoc.Sheets(2).Range("A1").Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With XLDoc.Sheets(2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Range("A1").PasteSpecial _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Operation=xlPasteSpecialOperationAdd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 11:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-paste-table-in-Excel-and-match-formatting-destination/m-p/5484#M904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-24T11:34:56Z</dc:date>
    </item>
  </channel>
</rss>

