Pausing while retrieving data

A

alex22

hi, everyone!


I have a query retrieving data from a remote database. The proces
takes some time. I have a code that defines the query criteria and the
manipulating the retrieved data.

What I'm not sure is if the execution of all commands is suspende
BEFORE all data are retrieved. It seems like some actions are take
while Excel is still loading the data.

Is there any way to pause before proceeding or in any way make sure n
action is taken before query finished refreshing?


Thanks!
 
G

Gjones

Hi Alex;

Unless you use code to tell it differently Excel executes
code step by step or non-Asynchronously. Unless you use
the Do Events call it is very unlikely the next command is
happening.

Thanks,

Greg
 
A

alex22

Thanks for your reply!

However, my colleague is trying to solve exactly the same problem an
here's what he found:

He's got 2 queries in the same spreadsheet plus VBA code working wit
the data from the queries. It is very clear that while the querie
haven't finished retrieving data, VBA is not waiting but executing al
the commands! So the code finishes but the data is still bein
retrieved, which defeats the purpose of the code.

There's an option to "disable background refresh" but this doesn't hel
either.

Isn't there some sort of "Pause before blah-blah" or "Wait for x
time" command? I couldn't find anything of the sort but maybe you know


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top