Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel. Stop/Start Macro

Status
Not open for further replies.

Wicca

Technical User
Mar 17, 2004
46
NZ
I have a macro that gets data from a SCADA system on the same computer.

However the macro runs faster than the download occurs and I get the error #N/A.
I have watched it happen and cannot see how to overcome it.

I tried an application.wait with a 2 sec and with a 10 sec delay but the whole thing stopped. Is there any way I can freeze the macro and still download the required data??

many thanks in advance



Merry Part and the Brightest of Blessings

With respect
Wicca
-----
IF you think you can
Or if you think you can't
Then you are probably right
-Henry Ford
 
If you are using the Get External data function and are using the
.REFRESH

method, you can utilise the BACKGROUND query mode by using either

Querytables(1).refresh (false)
or
Querytables(1).refresh backgroundquery:=false

If not, could you post the relevant code you are using to perform the query...

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Thanks Geoff

I managed to find an answer in the Threads

Thread707-600926

Application.OnTime

It allowed me to stop the macro for 2 seconds while the data updated and then carry on......

Thank you gals and guys for leaving such a valuable collection of information on the net

Merry Part and the Brightest of Blessings

With respect
Wicca
-----
IF you think you can
Or if you think you can't
Then you are probably right
-Henry Ford
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top