<?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 statements' execution order in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-statements-execution-order/m-p/971140#M332456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to write a macro which exports 2 images of different sheets for every value selected on a field.&lt;/P&gt;&lt;P&gt;I used macros a lot but this time I can't understand the code execution's behaviour. It seems that the statements of my function are not executed in the correct sequence.&lt;/P&gt;&lt;P&gt;For example, I have to activate a sheet and then export it as an image file. (I'm using this horrible practice because ActiveDocument.GetSheetByID("SHxx").ExportBitmapToFile and ActiveDocument.Sheets("sheet name").ExportBitmapToFile don't work if active sheet isn't the same I have to export... another VBS mystery).&lt;/P&gt;&lt;P&gt;Well, the statement which would export the sheet runs before the statement that has to activate the correct sheet and if I insert a wait of x seconds between the two statements, QlikView client stays locked for x seconds before the image is generated and only then the correct sheet is activated.&lt;/P&gt;&lt;P&gt;Have you ever had issues like this before? How can I control the correct sequence of statements forbidding execution of one before the previous has finished?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Nov 2015 17:06:15 GMT</pubDate>
    <dc:creator>mrossoit</dc:creator>
    <dc:date>2015-11-10T17:06:15Z</dc:date>
    <item>
      <title>Macro statements' execution order</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-statements-execution-order/m-p/971140#M332456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to write a macro which exports 2 images of different sheets for every value selected on a field.&lt;/P&gt;&lt;P&gt;I used macros a lot but this time I can't understand the code execution's behaviour. It seems that the statements of my function are not executed in the correct sequence.&lt;/P&gt;&lt;P&gt;For example, I have to activate a sheet and then export it as an image file. (I'm using this horrible practice because ActiveDocument.GetSheetByID("SHxx").ExportBitmapToFile and ActiveDocument.Sheets("sheet name").ExportBitmapToFile don't work if active sheet isn't the same I have to export... another VBS mystery).&lt;/P&gt;&lt;P&gt;Well, the statement which would export the sheet runs before the statement that has to activate the correct sheet and if I insert a wait of x seconds between the two statements, QlikView client stays locked for x seconds before the image is generated and only then the correct sheet is activated.&lt;/P&gt;&lt;P&gt;Have you ever had issues like this before? How can I control the correct sequence of statements forbidding execution of one before the previous has finished?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 17:06:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-statements-execution-order/m-p/971140#M332456</guid>
      <dc:creator>mrossoit</dc:creator>
      <dc:date>2015-11-10T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro statements' execution order</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-statements-execution-order/m-p/971141#M332457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 17:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-statements-execution-order/m-p/971141#M332457</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2015-11-10T17:12:40Z</dc:date>
    </item>
  </channel>
</rss>

