<?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 to generate PPT file (synchonization problem) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-generate-PPT-file-synchonization-problem/m-p/181212#M47323</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of the msgbox try waiting on QV with:&lt;/P&gt;&lt;P&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Mar 2010 08:51:03 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2010-03-17T08:51:03Z</dc:date>
    <item>
      <title>Macro to generate PPT file (synchonization problem)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-generate-PPT-file-synchonization-problem/m-p/181211#M47322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a macro in order to generate a PPT file.&lt;/P&gt;&lt;P&gt;In the macro I have a Loop to change Qlikview selection application &amp;amp; to re-export a sheet copy in PPT.&lt;/P&gt;&lt;P&gt;It's working but I have to insert a msgbox command in the code in order to have synchonization. If I delete the msgbox command I have the same copy screen in the PPT (the change selection is not updated in the PPT)&lt;/P&gt;&lt;P&gt;do you have any idea ?&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;sub exportToPPT()&lt;BR /&gt; dim i&lt;BR /&gt; dim loopDimensionValues&lt;BR /&gt; dim loopDimensionValue&lt;BR /&gt; dim pLoopDimensionField&lt;BR /&gt;&lt;BR /&gt; pLoopDimensionField = ActiveDocument.Variables("v_loop_dimension").GetContent().String&lt;BR /&gt; 'pLoopDimensionField = "VACCINE"&lt;BR /&gt;&lt;BR /&gt; ' PPT Template to use for export&lt;BR /&gt; ' TODO template as a parameter&lt;BR /&gt; vPPTTemplatePath = "C:\Mon Espace Disque\jbeausseron\10 - chantiers\Business Planning\Leo\Roadmap\prototypes\QV\PPT-prototype-JBN\Report_Template.ppt"&lt;BR /&gt;&lt;BR /&gt; ' QV object to export to PPT document&lt;BR /&gt; ' TODO ID of the object to export as a parameter&lt;BR /&gt; vObjectToCaptureId = "SHEET_MAIN"&lt;BR /&gt;&lt;BR /&gt; Set PPApp = CreateObject("Powerpoint.Application")&lt;BR /&gt; PPApp.Visible = True&lt;BR /&gt;&lt;BR /&gt; ' Creation of the PPT document&lt;BR /&gt; ' OPTION 1: From scratch : new document&lt;BR /&gt; 'Set PPPres = PPApp.Presentations.Add&lt;BR /&gt; ' OPTION 2: Creation from an existing PPT template&lt;BR /&gt; Set PPPres = PPApp.Presentations.Open(vPPTTemplatePath, -1) ' -1 = read only&lt;BR /&gt; ' Loop on appropriate dimension to generate One PPT slide per item&lt;BR /&gt; set loopDimensionValues = ActiveDocument.fields ( pLoopDimensionField ).GetPossibleValues&lt;BR /&gt; for i=0 to loopDimensionValues.Count - 1&lt;BR /&gt; loopDimensionValue = loopDimensionValues.Item(i).text&lt;BR /&gt;&lt;BR /&gt; ' Selecting the item in the appropriate control to filter data&lt;BR /&gt; ActiveDocument.Fields ( pLoopDimensionField ).Select loopDimensionValue&lt;BR /&gt;&lt;BR /&gt; ' Creation of the slide in the PPT document&lt;BR /&gt; ' TODO optimize the slide layout&lt;BR /&gt; Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, 3)&lt;BR /&gt;&lt;BR /&gt; ' Updating the slide with appropriate data&lt;BR /&gt; PPSlide.Shapes(1).TextFrame.TextRange.Text = pLoopDimensionField &amp;amp; ": " &amp;amp; loopDimensionValue&lt;BR /&gt;&lt;BR /&gt; ' TODO: find a clean way to avoid this ; here the msg box is used to let QV refreshing the sheet&lt;BR /&gt; ' an thus capture the sheet image correcly&lt;BR /&gt; msgbox("Exporting slide " &amp;amp; (i+1) &amp;amp; "...")&lt;BR /&gt;&lt;BR /&gt; ' Capture of the appropriate sheet as an image&lt;BR /&gt; ActiveDocument.Sheets(vObjectToCaptureId).CopyBitmapToClipboard&lt;BR /&gt; ' Paste in the PPT slide and position&lt;BR /&gt; ' TODO : generic position&lt;BR /&gt; PPSlide.Shapes.Paste&lt;BR /&gt; PPSlide.Shapes(PPSlide.Shapes.Count).Width = 0.9 * PPSlide.Master.Width&lt;BR /&gt; PPSlide.Shapes(PPSlide.Shapes.Count).Left = 0.05 * PPSlide.Master.Width&lt;BR /&gt; ' PPSlide.Shapes(PPSlide.Shapes.Count).Height = 0.75 * PPSlide.Master.Width&lt;BR /&gt; PPSlide.Shapes(PPSlide.Shapes.Count).Top = (0.25 / 2) * PPSlide.Master.Width&lt;BR /&gt; next&lt;BR /&gt;&lt;BR /&gt; Set PPSlide = Nothing&lt;BR /&gt; Set PPPres = Nothing&lt;BR /&gt; Set PPApp = Nothing&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 07:27:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-generate-PPT-file-synchonization-problem/m-p/181211#M47322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-16T07:27:07Z</dc:date>
    </item>
    <item>
      <title>Macro to generate PPT file (synchonization problem)</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-generate-PPT-file-synchonization-problem/m-p/181212#M47323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of the msgbox try waiting on QV with:&lt;/P&gt;&lt;P&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 08:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-generate-PPT-file-synchonization-problem/m-p/181212#M47323</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-03-17T08:51:03Z</dc:date>
    </item>
  </channel>
</rss>

