<?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 VBA MsgBox AFTER Background Query Completion in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/VBA-MsgBox-AFTER-Background-Query-Completion/m-p/3404254#M44148</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a message box that will show if the refreshing/loading of Queries are completed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I'm just looking at the bottom part of my Excel to know if it's still loading. I'd like to know if I can create a message box that will pop up once loading is done.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here's my VBA code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub RefreshAll()&lt;BR /&gt;'&lt;BR /&gt;' RefreshAll Macro&lt;BR /&gt;'&lt;BR /&gt;' Keyboard Shortcut: Ctrl+Shift+R&lt;BR /&gt;'&lt;BR /&gt;ActiveWorkbook.RefreshAll&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 11:28:34 GMT</pubDate>
    <dc:creator>Newbie22</dc:creator>
    <dc:date>2023-08-29T11:28:34Z</dc:date>
    <item>
      <title>VBA MsgBox AFTER Background Query Completion</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/VBA-MsgBox-AFTER-Background-Query-Completion/m-p/3404254#M44148</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create a message box that will show if the refreshing/loading of Queries are completed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I'm just looking at the bottom part of my Excel to know if it's still loading. I'd like to know if I can create a message box that will pop up once loading is done.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here's my VBA code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub RefreshAll()&lt;BR /&gt;'&lt;BR /&gt;' RefreshAll Macro&lt;BR /&gt;'&lt;BR /&gt;' Keyboard Shortcut: Ctrl+Shift+R&lt;BR /&gt;'&lt;BR /&gt;ActiveWorkbook.RefreshAll&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 11:28:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/VBA-MsgBox-AFTER-Background-Query-Completion/m-p/3404254#M44148</guid>
      <dc:creator>Newbie22</dc:creator>
      <dc:date>2023-08-29T11:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: VBA MsgBox AFTER Background Query Completion</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/VBA-MsgBox-AFTER-Background-Query-Completion/m-p/3404923#M44159</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="431205" data-lia-user-login="Newbie22" class="lia-mention lia-mention-user"&gt;Newbie22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you have 2 options to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;f you don't want to continue working in Excel while the refresh is ongoing, then you can turn off background refresh for &lt;STRONG&gt;each&lt;/STRONG&gt; query and so the next line of code after RefreshAll(), which could be a MsgBox, will only execute after refresh is done.&lt;BR /&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;img /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;If you want to continue working in Excel while RefreshAll() is executing in the background, then you can implement an AfterRefresh event handler for &lt;STRONG&gt;each&lt;/STRONG&gt; query. Once refresh has finished for all refreshes, e.g. count how many &lt;A href="https://learn.microsoft.com/en-us/office/vba/api/excel.querytable.afterrefresh" target="_self"&gt;AfterRefresh&lt;/A&gt; Events already occured, then finally show the message box. Example see here:&amp;nbsp;&lt;A href="http://www.vbaexpress.com/forum/showthread.php?30743-DoEvents-ActiveWorkbook-RefreshAll-Run-second-part-of-Macro-Once-Complete&amp;amp;s=dedbae73809c7fdb006a4cc805dba9e7&amp;amp;p=206543&amp;amp;viewfull=1#post206543" target="_blank" rel="noopener"&gt;http://www.vbaexpress.com/forum/showthread.php?30743-DoEvents-ActiveWorkbook-RefreshAll-Run-second-part-of-Macro-Once-Complete&amp;amp;s=dedbae73809c7fdb006a4cc805dba9e7&amp;amp;p=206543&amp;amp;viewfull=1#post206543&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P class="lia-align-right"&gt;&lt;A title="GitHub" href="https://github.com/MartinBubenheimer" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;A title="linkedin" href="https://www.linkedin.com/in/martin-bubenheimer-9ba99271/" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 16:30:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/VBA-MsgBox-AFTER-Background-Query-Completion/m-p/3404923#M44159</guid>
      <dc:creator>Martin_D</dc:creator>
      <dc:date>2023-08-29T16:30:48Z</dc:date>
    </item>
  </channel>
</rss>

