• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Msgbox when background query refresh completed using macro

webmax

Member
Hi,
I am using power query to extract the data from the external website. Also this power query is running in background for every 30 minutes to fetch the data and update in excel workbook.
My requirement is i need VBA macro code if the background query refresh completed then i need Message box as Completed.
Thanks
Sham
 
Seems to me that shouldn't be very hard. But knowing when the refresh has been completed — surely that depends on how you're doing the extract in the first place. Can you show some sample code?
 
You can use the Worksheet_TableUpdate event IF the query is connected to the Data Model, for example:
Code:
Private Sub Worksheet_TableUpdate(ByVal Target As TableObject)
MsgBox Target.ListObject.Name & " just updated"
End Sub
You can be specific about which table(s) updating cause the message to appear with the likes of:
Code:
Private Sub Worksheet_TableUpdate(ByVal Target As TableObject)
If Target.ListObject.Name = "Table2" Then MsgBox Target.ListObject.Name & " just updated"
End Sub
 
Back
Top