I have the following case: I have several excel files, which contain pivot tables. These files need to be refreshed regularly. I do not want to do it manually, so I created a code in a separate file. The code shoule open each of the specified excel, rehresh the pivot table, save and close. The interesting part is open file not a problem, then the code is: ActiveWorkbook.RefreshAll ActiveWorkbook.Save ActiveWorkbook.Close
If you debug step by step all is fine, but if you run the code you get an error between RefreshAll and Save. Reason: The Save command is executed WHILE the pivt table is still refreshing and this generates an error, whereas if you allow the rferhesh t complete, no error. So, is there a way to tell the system to wait until refrehs is complete, before moving to the Save command?
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Excel Forum.