<?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: Export to Excel macro - issue exporting table text in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008938#M1221652</link>
    <description>&lt;P&gt;Hi Marcus,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to help.&lt;/P&gt;
&lt;P&gt;I tried putting .Value in as you suggested, and the macro just stopped running after that line. Then I tried taking .Value back out again and the macro still stops running after that line.&lt;/P&gt;
&lt;P&gt;Somehow I've managed to completely break the macro&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":expressionless_face:"&gt;😑&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you have any other thoughts at all, please let me know&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 17:17:08 GMT</pubDate>
    <dc:creator>jessica_webb</dc:creator>
    <dc:date>2022-11-24T17:17:08Z</dc:date>
    <item>
      <title>Export to Excel macro - issue exporting table text</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008819#M1221647</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;I'm creating a series of macros to export many different charts, tables and titles into an Excel document.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With my macro below, everything is working exactly as it should, except the first three tables (table1, table2 and table3). With these, I get the value of 'title1' being pasted into the specified cells (B9, B23 and I23). As I said, everything else copies over exactly as it should, so why is the value of 'title1' being copied over?!&lt;/P&gt;
&lt;P&gt;Any help appreciated because I am STUCK!&lt;/P&gt;
&lt;P&gt;Public XLDoc&lt;BR /&gt;Public XLSheet1&lt;/P&gt;
&lt;P&gt;sub openExcel&lt;BR /&gt;&lt;BR /&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;
&lt;P&gt;XLApp.Visible = True&lt;/P&gt;
&lt;P&gt;Set XLDoc = XLApp.Workbooks.Open("Excel report proto - macros.xlsx")&lt;BR /&gt;set XLSheet1 = XLDoc.Worksheets(1)&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;sub ExportText&lt;BR /&gt;&lt;BR /&gt;'Copy title&lt;BR /&gt;set title1 = ActiveDocument.GetSheetObject("TX324")&lt;BR /&gt;XLSheet1.Range("C2") = title1.GetText() &lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table1 = ActiveDocument.GetSheetObject("CH478")&lt;BR /&gt;table1.CopyTextToClipboard&lt;BR /&gt;XLSheet1.Range("B9").PasteSpecial&lt;BR /&gt;&lt;BR /&gt;set table2 = ActiveDocument.GetSheetObject("CH393")&lt;BR /&gt;table2.CopyTextToClipboard&lt;BR /&gt;XLSheet1.Range("B23").PasteSpecial&lt;BR /&gt;&lt;BR /&gt;set table3 = ActiveDocument.GetSheetObject("CH392")&lt;BR /&gt;table3.CopyTextToClipboard&lt;BR /&gt;XLSheet1.Range("I23").PasteSpecial&lt;BR /&gt;&lt;BR /&gt;'Copy title&lt;BR /&gt;set title2 = ActiveDocument.GetSheetObject("TX329")&lt;BR /&gt;XLSheet1.Range("B36") = title2.GetText() &lt;BR /&gt;&lt;BR /&gt;'Copy chart&lt;BR /&gt;set chart1 = ActiveDocument.GetSheetObject("CH374")&lt;BR /&gt;chart1.CopyBitmapToClipboard&lt;BR /&gt;XLSheet1.Range("B38").PasteSpecial DataType=wdPasteBitmap&lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table4 = ActiveDocument.GetSheetObject("CH375")&lt;BR /&gt;table4.CopyTextToClipboard&lt;BR /&gt;XLSheet1.Range("B56").PasteSpecial &lt;BR /&gt;&lt;BR /&gt;'Copy chart&lt;BR /&gt;set chart2 = ActiveDocument.GetSheetObject("CH388")&lt;BR /&gt;chart2.CopyBitmapToClipboard&lt;BR /&gt;XLSheet1.Range("B78").PasteSpecial DataType=wdPasteBitmap&lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table5 = ActiveDocument.GetSheetObject("CH380")&lt;BR /&gt;table5.CopyTextToClipboard&lt;BR /&gt;XLSheet1.Range("B96").PasteSpecial&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 13:30:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008819#M1221647</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2022-11-24T13:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel macro - issue exporting table text</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008832#M1221649</link>
      <description>&lt;P&gt;I think the title-stuff isn't created as a copy-job else it's a writing-job whereby it's not specified which property of the cell-object should be addressed. Therefore, try it with the following adjustment:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;XLSheet1.Range("C2")&lt;STRONG&gt;.Value&lt;/STRONG&gt; = title1.GetText()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 13:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008832#M1221649</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-24T13:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel macro - issue exporting table text</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008938#M1221652</link>
      <description>&lt;P&gt;Hi Marcus,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to help.&lt;/P&gt;
&lt;P&gt;I tried putting .Value in as you suggested, and the macro just stopped running after that line. Then I tried taking .Value back out again and the macro still stops running after that line.&lt;/P&gt;
&lt;P&gt;Somehow I've managed to completely break the macro&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":expressionless_face:"&gt;😑&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you have any other thoughts at all, please let me know&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 17:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008938#M1221652</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2022-11-24T17:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel macro - issue exporting table text</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008941#M1221653</link>
      <description>&lt;P&gt;Have somehow managed to fix this, so in case anyone else comes across this issue...&lt;/P&gt;
&lt;P&gt;For some reason, in a couple of instances, QV macro didn't like&amp;nbsp;'&lt;SPAN&gt;table1.&lt;STRONG&gt;CopyTextToClipboard&lt;/STRONG&gt;' (although didn't seem to have a problem in other places, weirdly).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Anyway, updated and currently working macro is:&lt;/P&gt;
&lt;P&gt;Public XLDoc&lt;BR /&gt;Public XLSheet1&lt;/P&gt;
&lt;P&gt;sub openExcel&lt;BR /&gt;&lt;BR /&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;
&lt;P&gt;XLApp.Visible = True&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Set XLDoc = XLApp.Workbooks.Open("Excel report proto - macros.xlsx")&lt;/SPAN&gt;&lt;BR /&gt;set XLSheet1 = XLDoc.Worksheets(1)&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;sub ExportText&lt;BR /&gt;&lt;BR /&gt;'Copy title&lt;BR /&gt;set title1 = ActiveDocument.GetSheetObject("TX324")&lt;BR /&gt;XLSheet1.Range("C2") = title1.GetText() &lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table1 = ActiveDocument.GetSheetObject("CH478")&lt;BR /&gt;table1.CopyTableToClipboard (false)&lt;BR /&gt;XLSheet1.Range("B9").PasteSpecial Paste = xlPasteValues&lt;BR /&gt;&lt;BR /&gt;set table2 = ActiveDocument.GetSheetObject("CH393")&lt;BR /&gt;table2.CopyTableToClipboard (false)&lt;BR /&gt;XLSheet1.Range("B23").PasteSpecial Paste = xlPasteValues&lt;BR /&gt;&lt;BR /&gt;set table3 = ActiveDocument.GetSheetObject("CH392")&lt;BR /&gt;table3.CopyTableToClipboard (false)&lt;BR /&gt;XLSheet1.Range("I23").PasteSpecial Paste = xlPasteValues&lt;BR /&gt;&lt;BR /&gt;'Copy title&lt;BR /&gt;set title2 = ActiveDocument.GetSheetObject("TX329")&lt;BR /&gt;XLSheet1.Range("B36") = title2.GetText() &lt;BR /&gt;&lt;BR /&gt;'Copy chart&lt;BR /&gt;set chart1 = ActiveDocument.GetSheetObject("CH374")&lt;BR /&gt;chart1.CopyBitmapToClipboard&lt;BR /&gt;XLSheet1.Range("B38").PasteSpecial DataType=wdPasteBitmap&lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table4 = ActiveDocument.GetSheetObject("CH375")&lt;BR /&gt;table4.CopyTableToClipboard (false)&lt;BR /&gt;XLSheet1.Range("B56").PasteSpecial Paste = xlPasteValues&lt;BR /&gt;&lt;BR /&gt;'Copy chart&lt;BR /&gt;set chart2 = ActiveDocument.GetSheetObject("CH388")&lt;BR /&gt;chart2.CopyBitmapToClipboard&lt;BR /&gt;XLSheet1.Range("B78").PasteSpecial DataType=wdPasteBitmap&lt;BR /&gt;&lt;BR /&gt;'Copy tables&lt;BR /&gt;set table5 = ActiveDocument.GetSheetObject("CH380")&lt;BR /&gt;table5.CopyTableToClipboard (false)&lt;BR /&gt;XLSheet1.Range("B96").PasteSpecial Paste = xlPasteValues&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 17:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2008941#M1221653</guid>
      <dc:creator>jessica_webb</dc:creator>
      <dc:date>2022-11-24T17:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Excel macro - issue exporting table text</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2009092#M1221661</link>
      <description>&lt;P&gt;The clipboard is a complex matter and don't belong to Qlik else it's an OS feature which is administers from the OS and all tools and services could use it at any time. Therefore, conflicts between them and/or in regard to the number, size and the kind of the copied content are possible although in my experience it's rather seldom that this really happens.&lt;/P&gt;
&lt;P&gt;Quite more common are timely conflicts caused from the calling tool itself. Means the tool might be already executing the third code-statement while the OS is further busy to execute the I/O task from the first code-statement ...&lt;/P&gt;
&lt;P&gt;This leads quite often to the requirement to delay the code-execution and/or to check the successfully execution of the previous statements before going on. Within QlikView vbs-script it could be mostly handled with WaitForIdle statements to ensure that all QlikView calculations are finished before the next step comes and Sleep statements which just paused n milliseconds (here it's just a guessing which values are sensible - in our older environment I needed 4 seconds to ensure that exports where really finished and within the new one values of around 1 second are enough - maybe less would be sufficient but the run-times are fine for me and I don't need more optimization yet).&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 08:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-Excel-macro-issue-exporting-table-text/m-p/2009092#M1221661</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-25T08:34:28Z</dc:date>
    </item>
  </channel>
</rss>

