View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
bzm
 
Posts: n/a
Default Prevent error messagebox when refresing querytable from the web fails

Hi,

I have an excel workbook with a querytable on a sheet
The querytable retrieve data from a web site, and I need that data to
be checked automatically, and saved when some data is changed.
So I create a class to implement QueryTable events, and I have my own
code in AfterRefresh, which saves changed data

I need this to be checked and saved automatically, regardless if I'm in
from of PC or not, so I set the querytable to refresh automatically
with 1 minute RefreshPeriod. Also, the querytable based obrect is
instantiated when I open the worbook

If sometimes data cannot be retrieved from the web, Excel opens a
Messagebpox telling me that it cannot access the url to retrieve data.
Unfortunately, this popup must be closed manually, by user, otherwise a
new refresh doesn't occurs.

What I want it to disable somehow that error message. Is there any way
to do that? If at some point the querytable cannot load data from the
web, that's it, it's not a big deal, but I want it to keep refreshing
as usual, since the connection will eventually go up again and further
data can be read.

Does anyone know how to do that? I tried to add sendkeys "{Enter}" in
BeforeRefresh event, hoping that in case of that messagebox, enter will
reach it and close, but don't work

Thanks for any suggestion

(PS: I use Excel2003)