<?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: Copy to Clipboard Fails (macro) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756744#M1038809</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 using application.waitforidle before copying the chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harsha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Dec 2014 06:33:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-12-18T06:33:39Z</dc:date>
    <item>
      <title>Copy to Clipboard Fails (macro)</title>
      <link>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756743#M1038808</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;I have a macro which is supposed to be very basic. It copies and pastes 3 different straight table charts' data to excel, then I need to make a selection in a field and paste the same tables with the updated data in a second sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The part from making the selections onwards I haven't even gotten to because for some crazy reason I keep getting a "copy to clipboard failed" error when trying to copy and paste the 3 objects' values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried commenting out pieces of the code to isolate the problem. If I copy and paste them 1 by 1 it is fine. If I copy CH01 and CH03 but comment out CH02 it's fine too. CH02 on its own is fine too, but when combining it with one or both of the others it fails. CH02 is identical to the others in all formatting etc. except that the number format is different, but even when I make them all the same format it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I should clear the clipboard memory in-between pastes? I am lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code, and attached are images showing the charts and the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff00ff;"&gt;&lt;EM&gt;Sub Run_Report_1&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;dtmDate = Date&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strYear = year(Date()-8)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strMonth = month(Date()-8)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strMonth) = 1 then strMonth = "0" &amp;amp; strMonth&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strDay = day(Date()-8)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strDay) = 1 then strDay = "0" &amp;amp; strDay&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strYesterYear = year(Date()-1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strYesterMonth = month(Date()-1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strYesterMonth) = 1 then strYesterMonth = "0" &amp;amp; strYesterMonth&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;strYesterDay = day(Date()-1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;if len(strYesterDay) = 1 then strYesterDay = "0" &amp;amp; strYesterDay&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;'---------------------------- Sheet 1: Trading Calendar Month to Date ----------------------------------' &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLApp = CreateObject("Excel.Application")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Visible = False&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLDoc = XLApp.Workbooks.Open ("C:\Users\tenba1\Documents\QlikView\Cross Shopping\Cross Shopping Report - " &amp;amp; strYear &amp;amp; "-" &amp;amp; strMonth &amp;amp; "-" &amp;amp; strDay &amp;amp; ".xlsx")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;SET XLSheet1 = XLDoc.Worksheets(1)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLSheet1.Paste XLSheet1.Range("B4")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;ActiveDocument.GetSheetObject("CH02").CopyTableToClipboard true&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLSheet1.Paste XLSheet1.Range("B14")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard true&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLSheet1.Paste XLSheet1.Range("B24")&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Visible = False&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLDoc.SaveAs "C:\Users\tenba1\Documents\QlikView\Cross Shopping\Cross Shopping Report - " &amp;amp; strYesterYear &amp;amp; "-" &amp;amp; strYesterMonth &amp;amp; "-" &amp;amp; strYesterDay &amp;amp; ".xlsx"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;EM&gt;&lt;STRONG&gt;XLApp.Quit&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff00ff;"&gt;&lt;EM&gt;End Sub&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 06:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756743#M1038808</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2014-12-18T06:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Copy to Clipboard Fails (macro)</title>
      <link>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756744#M1038809</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 using application.waitforidle before copying the chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harsha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 06:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756744#M1038809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-18T06:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Copy to Clipboard Fails (macro)</title>
      <link>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756745#M1038810</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;This didn't work, but I just figured out the problem (by pure luck).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The computer with the QV licence is separate to my laptop, and I was accessing it and working on the QV module remotely from my laptop. To do this I used TeamViewer, and TeamViewer has a setting to keep the clipboards to the 2 computers in synch. This confused the hell out of QlikView I guess. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turned off this setting and it works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 07:02:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Copy-to-Clipboard-Fails-macro/m-p/756745#M1038810</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2014-12-18T07:02:01Z</dc:date>
    </item>
  </channel>
</rss>

