Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11   Report Post  
Old January 17th 06, 08:59 AM 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

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   Report Post  
Old January 17th 06, 11:15 AM posted to microsoft.public.excel.programming,microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.newusers
Ken Johnson
 
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   Report Post  
Old January 17th 06, 01:19 PM 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

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   Report Post  
Old January 17th 06, 01:24 PM 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,

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent error messagebox when refresing querytable from the web fails bzm Excel Discussion (Misc queries) 16 January 17th 06 03:32 PM


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2004-2020 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017