<?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: Macro to paste in excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461233#M1157582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;sub ExportExcel()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp; xlApp.Visible = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set xlDoc = xlApp.Workbooks.Add()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set xlSheet = xlDoc.Worksheets.Add&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; Set SheetObj = ActiveDocument.GetSheetObject("CH01")&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SheetObj.CopyTableToClipboard true&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xlSheet.Range("B1").PasteSpecial&amp;nbsp; Paste = xlPasteValues&lt;/P&gt;&lt;P&gt;End sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jan 2013 07:51:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-28T07:51:51Z</dc:date>
    <item>
      <title>Macro to paste in excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461232#M1157581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a pretty basic macro which opens the pevious day's Excel report, and pastes the updated QLikView data into the existing excel tables, and saves the excel report with a new date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mostly just like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ActiveDocument.GetSheetObject("CH225").CopyTableToClipboard true&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;XLSheet1.Paste XLSheet1.Range("C3")&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is if I can paste to "&lt;SPAN style="text-decoration: underline;"&gt;match destination formatting&lt;/SPAN&gt;" - i.e. I want to use the exisiting formatting the report has in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do I need to paste and the&amp;nbsp; change all of the formatting from within the macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 05:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461232#M1157581</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-28T05:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to paste in excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461233#M1157582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;sub ExportExcel()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp; xlApp.Visible = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set xlDoc = xlApp.Workbooks.Add()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set xlSheet = xlDoc.Worksheets.Add&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; Set SheetObj = ActiveDocument.GetSheetObject("CH01")&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SheetObj.CopyTableToClipboard true&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xlSheet.Range("B1").PasteSpecial&amp;nbsp; Paste = xlPasteValues&lt;/P&gt;&lt;P&gt;End sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 07:51:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461233#M1157582</guid>
      <dc:creator />
      <dc:date>2013-01-28T07:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to paste in excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461234#M1157583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - that worked perfectly. Just had to change all currency fields in my QV table to number, otherwise it pasted it as text in excel for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note - I've noticed that when testing macros, it sometimes creates temporary excel files (like when you have an excel file open and it shows a hidden file with the same name in explorer), and even when the actual file is closed, this hidden file remains. I cannot delete it (says it is being used by another program or person), and then I ahve to go to task manager and kill all excel processes (of which a new one seems to be created each time I run the macro - I sometimes have to kill up to 5 or 6 EXCEL.exe processes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 08:10:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461234#M1157583</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2013-01-28T08:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to paste in excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461235#M1157585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought this worked fine in my case too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it doens't seem to work as expected when you have line feeds in some values.&lt;/P&gt;&lt;P&gt;I would appreciate if you could have some other solutions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 01:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461235#M1157585</guid>
      <dc:creator>cts_shin</dc:creator>
      <dc:date>2017-12-21T01:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to paste in excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461236#M1157586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could not find a technical solution for line feeds.&lt;/P&gt;&lt;P&gt;So we checked the business requirements and decided to replace all the line feeds into blanks when reloading data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2017 06:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-paste-in-excel/m-p/461236#M1157586</guid>
      <dc:creator>cts_shin</dc:creator>
      <dc:date>2017-12-29T06:17:51Z</dc:date>
    </item>
  </channel>
</rss>

