I am iterating through a for/next loop where each loops retrieves data from a database and outputs data to a .txt file. There are about 3000 iterations (for x = 1 to 3000).
What ends up happening, I think, is that Excel cannot read & write data fast enough to keep up with the for/next loop iterations...and ends up skipping some files and not outputting a .txt file at all. Thus, I am missing some important data files.
How can I "slow down" the for/next loop such that it waits 1 full second before moving onto the next iteration? However, I don't want to "pause" the program because the data will not get read/written/outputted to a .text file if the program is paused. Basically I want to give the macro time to output data before it moves onto the next iteration. How do I do this?