A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Prevent error messagebox when refresing querytable from the web fails



 
 
Thread Tools Display Modes
  #11  
Old January 17th, 2006, 09:59 AM posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Prevent error messagebox when refresing querytable from the web fails

Actually, DisplayAlerts seems ok, but somehow it gets reset to true
when I get back in class module, AfterRefresh event. Does anyone know
how to persist that?

Thanks,
Bogdan

  #12  
Old January 17th, 2006, 12:15 PM posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Prevent error messagebox when refresing querytable from the web fails

Hi bzm,
If you can see where and what is causing the error you might get away
with:

On Error Resume Next

placed before the offending line then:

On Error Goto 0

after the offending line.

Ken Johnson

  #13  
Old January 17th, 2006, 02:19 PM posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Prevent error messagebox when refresing querytable from the web fails

I know that, but the problem is the error is caused when the
auto-refresh of the QueryTable object. And I don't trigger it, instead
it is triggered automatically, sinc I set the QueryTable as

qtQueryTable.BackgroundQuery = True
qtQueryTable.RefreshPeriod = 1

So it is refreshed automatocally

A possible approach would be not use user QueryTable.RefreshPeriod, but
instead use a timer, and in timer event, call QueryTable.Refresh (after
an "On Error Resume Next" statement)

However, I cannot find a timer object in Excel. Is there any way to use
one? Or should I use some API code to call a Windows timer?

Thanks for all suggestions

Regards,
Bogdan

  #14  
Old January 17th, 2006, 02:24 PM posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
external usenet poster
 
Posts: n/a
Default Prevent error messagebox when refresing querytable from the web fails

Hi,

After a little more research, I found Application.OnTime method, which
allow to run code at certain time.
This seems to be a solution, I can set Application.DisplayAlerts=false
and call Querytable.Refresh with error handler off.
I'll try it.

Thanks to all for all answers.
Regards,
Bogdan

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.