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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|