<?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 CopyBitmapToClipboard works sometimes but not always in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302915#M112071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been digging through the forum and found some solutions to my problem. But now I am faced with a situation I cannot explain. Maybe somebody has experienced and solved this one....&lt;/P&gt;&lt;P&gt;Using: Excel 2007 and QV 10.00.9061.7 SR3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating an Excel report from Qlikview using a vbscript macro inside QV. The QV has both pivot tables and pie charts, on several tabs that need to be exported to Excel in different sheets to create a monthly report. I have created bookmarks for (almost) every analyses in the QV, plus a few macro's that will calculate the right months selections.&lt;/P&gt;&lt;P&gt;So far so good, and everything works for the first tab and first sheet in Excel. Pivot tables are o problem at all, they export as a charm and I copy and paste them in the master report. But when I get to the second sheet in my QV, I have the same pie chart, but with a slightly different selection (different sales team). Now all of a sudden the .CopyBitmapToClipboard does not seem to work anymore. Either the previous analyses that was copied to the clipboard gets pasted as an image, or (when I clear the clipboard between two analyses) I get an Excel error telling me there is no image to paste.&lt;/P&gt;&lt;P&gt;Tried so far&lt;/P&gt;&lt;P&gt;- add the &lt;STRONG&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/STRONG&gt; in several places, which actually made the first sheet work&lt;/P&gt;&lt;P&gt;- clear the clipboard by copying an empty cell from excel between two analyses&lt;/P&gt;&lt;P&gt;- have a timer/wait loop in vbscript before calling the .CopyBitmapToClipboard method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of which don't change a thing. The first set works, but the second and third run don't I activate the sheets that the objects are on. Make sure they are not minimised before I try the copy command. Doing things manually works, but through code I can't get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2011 10:54:44 GMT</pubDate>
    <dc:creator>happydays1967</dc:creator>
    <dc:date>2011-09-30T10:54:44Z</dc:date>
    <item>
      <title>CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302915#M112071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been digging through the forum and found some solutions to my problem. But now I am faced with a situation I cannot explain. Maybe somebody has experienced and solved this one....&lt;/P&gt;&lt;P&gt;Using: Excel 2007 and QV 10.00.9061.7 SR3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating an Excel report from Qlikview using a vbscript macro inside QV. The QV has both pivot tables and pie charts, on several tabs that need to be exported to Excel in different sheets to create a monthly report. I have created bookmarks for (almost) every analyses in the QV, plus a few macro's that will calculate the right months selections.&lt;/P&gt;&lt;P&gt;So far so good, and everything works for the first tab and first sheet in Excel. Pivot tables are o problem at all, they export as a charm and I copy and paste them in the master report. But when I get to the second sheet in my QV, I have the same pie chart, but with a slightly different selection (different sales team). Now all of a sudden the .CopyBitmapToClipboard does not seem to work anymore. Either the previous analyses that was copied to the clipboard gets pasted as an image, or (when I clear the clipboard between two analyses) I get an Excel error telling me there is no image to paste.&lt;/P&gt;&lt;P&gt;Tried so far&lt;/P&gt;&lt;P&gt;- add the &lt;STRONG&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/STRONG&gt; in several places, which actually made the first sheet work&lt;/P&gt;&lt;P&gt;- clear the clipboard by copying an empty cell from excel between two analyses&lt;/P&gt;&lt;P&gt;- have a timer/wait loop in vbscript before calling the .CopyBitmapToClipboard method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of which don't change a thing. The first set works, but the second and third run don't I activate the sheets that the objects are on. Make sure they are not minimised before I try the copy command. Doing things manually works, but through code I can't get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 10:54:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302915#M112071</guid>
      <dc:creator>happydays1967</dc:creator>
      <dc:date>2011-09-30T10:54:44Z</dc:date>
    </item>
    <item>
      <title>CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302916#M112072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Hello.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;had&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;something similar&lt;/SPAN&gt;. &lt;SPAN class="hps"&gt;Found a way&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;build:&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps atn"&gt;ActiveDocument.GetSheetObject ("CH8-&lt;/SPAN&gt;4"). Restore&lt;BR /&gt; &lt;SPAN class="hps atn"&gt;Set obj4 = ActiveDocument.GetSheetObject ("CH8-&lt;/SPAN&gt;4")&lt;BR /&gt; &lt;SPAN class="hps"&gt;obj4.CopyBitmapToClipboard&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;ExcelDoc.Sheets (SheetName). &lt;SPAN style="text-decoration: underline;"&gt;PasteSpecial&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 11:21:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302916#M112072</guid>
      <dc:creator />
      <dc:date>2011-09-30T11:21:01Z</dc:date>
    </item>
    <item>
      <title>CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302917#M112073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, nevermind...... As it turns out, the .CopyBitmapToClipboard &lt;STRONG&gt;only works when the sheet the object is on is active&lt;/STRONG&gt;. So when before starting to export from the next sheet activating this sheet did the job.&lt;/P&gt;&lt;P&gt;Something to be aware of, as exporting pivot tables to Excel works fine when the sheet they are on is not active.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 11:23:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302917#M112073</guid>
      <dc:creator>happydays1967</dc:creator>
      <dc:date>2011-09-30T11:23:20Z</dc:date>
    </item>
    <item>
      <title>CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302918#M112074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not only does it need to be on the active sheet, it will also not work if the object is minimized.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 11:31:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302918#M112074</guid>
      <dc:creator>kji</dc:creator>
      <dc:date>2011-09-30T11:31:46Z</dc:date>
    </item>
    <item>
      <title>CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302919#M112075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed, very important point. So, for everybody searching for a solution to the same problem:&lt;/P&gt;&lt;P&gt;For the .CopyBitmapToClipboard method of the chart-type sheetobject to work&lt;/P&gt;&lt;P&gt;- The sheet it resides on must be active&lt;/P&gt;&lt;P&gt;- the chart must be visible, i.e. NOT minimized&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set oDoc = ActiveDocument&lt;/P&gt;&lt;P&gt; set oSht = oDoc.Sheets(i)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' where i is the index (counting from left to right, starting from 1) of the sheet your&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;&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;&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;&amp;nbsp; charts are on &lt;/P&gt;&lt;P&gt;oSht.Activate&lt;/P&gt;&lt;P&gt;oShtObjs = oSht.GetSheetObjects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for j = 0 to uBound(oShtObjs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set oObj = oShtObjs(j)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sObjID = oObj.GetObjectID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; oObj.GetObjectType = 13 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'To make it really tidy you could check if the object is already NOT minimized, but hey.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oObj.Restore&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oObj.CopyBitmapToClipboard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oObj.Minimize&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 13:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302919#M112075</guid>
      <dc:creator>happydays1967</dc:creator>
      <dc:date>2011-09-30T13:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: CopyBitmapToClipboard works sometimes but not always</title>
      <link>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302920#M112076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very good thread and a perfect answer! Thank you very much for this. I experienced the very same problem and have just found the answer here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 14:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CopyBitmapToClipboard-works-sometimes-but-not-always/m-p/302920#M112076</guid>
      <dc:creator>murozel76</dc:creator>
      <dc:date>2013-06-17T14:49:54Z</dc:date>
    </item>
  </channel>
</rss>

