Wait for excel to finish formatting


I have a really large excel files and I need to do some formating on them. Afterwards I execute some more activities. Unfortunately formating excel takes so long, that I often get timeouts on the activities that are following the formatting. Is there any elegant way to make sure that excel finished formatting?

(I have no prior knowledge of how many rows or columns there will be, or what the values will be)