Disabling error message with Web Query

G

Guest

Hi everyone,

I have developed an Excel Web Query that queries data from a web server and
put them into a database through VBA after refreshing. That query is running
in background and refreshes data every 30 minutes.
It happens the web server is not always available and the web query shows an
error message box ("Unalbe to http://webserver... Cannot locate the internet
server..."). The poblem is when this box appears the After_Refresh method not
execute as long as somebody clicks on the "OK" command button of the message
box.
Any idea to by pass this error message or making it not appear?

Regards,
 
T

Tim Williams

Try

Application.Displayalerts=False
'refresh query
Application.Displayalerts=True
 
G

Guest

Tim, thanks for your response.
You're almost there. But, not worked properly because the Refresh method
from web query is not triggered by a macro. It's a process that runs in
background (do you know how we can deal with it?). This property only disable
alert messages coming from macro.
Any other idea?
 
T

Tim Williams

Have you tried using a mcro to refresh the query instead of having it run automatically ?
You could use Application.OnTime()
 
T

Tim Williams

Create the query with automatic refresh tuned off, then use the Refresh
method to update it.

activesheet.querytables("tablename").refresh

I haven't tested that this doesn't still show the dialog though....

Tim
 

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

Similar Threads

Excel Web Query 1
Web query 5
When a web query fails. 2
External Web Query 3
strange 400 error from web query 1
execute code after web query 2
Refreshing Web Query & Saving 2
Web query problems 4

Top