Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to call a macro just after all queries have been refreshed?

Dear Gurus,

in BI 7.0 workbook we have three different queries. We have also a macro which is called after refresh with the correct signiture. What we need is that the macro is called only once after all queries are refreshed. Currently it is called after refresh of every query which means it is executed three times and it takes a long time for the user to wait.

Any help in this issue will be highly appreciated.



Former Member
Former Member replied

What you can do is to check in the macro called everytime which query is refreshed, and to trigger the code only when the last query is refreshed.

By putting a counter or checking the query ID or the resultarea location, you could find the solution.

What I would do is : define an excel cell which will contain the counter.

In the macro, put a code like this one (not real VBa, pseudo code)

If counter >= 3

  • this ensure resetting the counter at every run

counter = 1


counter = counter + 1


If counter = 3

Your code here


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question