Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
10500438
Helper II
Helper II

Trigger Macro after all the Power Queries have updated

I have a power pivot model that has 10 queries, I have it set to refresh all when the workbook is opened. I have an Model Change event to save the workbook. Then a save event that triggers a macro to make a copy of the workbook with a timestamp.

 

I am trying to trigger a the event after ALL the power queries have updated in a single workbook. I have 10 queries and I am using the Model Change event, but as soon as the first query updates, it appears the macro is running. I tried using a VBscript through task scheduler, but it is triggering while the Model is still updating (it takes about 10min for the model to Refresh ALL).

 

I have worked on this for 3 days and I keep running into various issues. Is there a way to delay the Model Change event by 15min or something? Any suggestions are welcomed?

2 REPLIES 2
AlB
Super User
Super User

Hi @10500438 

Perhaps this would be of help?

https://community.powerbi.com/t5/Power-Query/Delay-web-query-until-condition-met-from-another-web-qu...

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

I think I am trying to delay the vba from running until all the queries have updated. 

 

I know I can use Application.Wait, but I was hoping there was a way to determine the updating sequence of the queries and then use the last query updated to kick off the vba.

 

Any thoughts?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors