Macro for Bulk Export of Stems - I Made One

I have made a macro to make the export.
It works very well, but I can not insert the pause to “wait for the process to finish”, I do not know how to insert it correctly, then the only thing I can do is calculate how long it will take approximately the export of each track and change it in each song .
It is not the idea to change it every time.

Can someone help me to do this please?

Thank you very much