View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Invalid Web Query Error

Yuo may want to try to open an Access application instead of doing a query


AccessObj = getObject("c:\temp\MyDataBase.mdb")
Set qdfBonusEarners = AccessObj.CreateQueryDef("")
With qdfBonusEarners
.Connect = "ODBC;DATABASE=pubs;UID=sa;PWD=;" & _
"DSN=Publishers"
.SQL = "SELECT * FROM titleauthor " & _
"WHERE title_id = '" & _
rstTopSeller!title_id & "'"
Set rstBonusRecipients = .OpenRecordset()
End With


or
AccessApp = Createobject("Access.Applicatioon")
AccessApp.Visible = true
AccessObj = AccessApp.OPenDataBase("c:\temp\MyDataBase.mdb",Tr ue,True)
Set qdfBonusEarners = AccessObj.CreateQueryDef("")
With qdfBonusEarners
.Connect = "ODBC;DATABASE=pubs;UID=sa;PWD=;" & _
"DSN=Publishers"
.SQL = "SELECT * FROM titleauthor " & _
"WHERE title_id = '" & _
rstTopSeller!title_id & "'"
Set rstBonusRecipients = .OpenRecordset()
End With


"Alfredo_CPA" wrote:

How can Ignore a "Invalid Web Query Error". I need excel to ignore the error
and keep procesing the next tables and them process again based in the
refresh period
This is my code:
Application.DisplayAlerts = False
On Error Resume Next
With Sheets("1").QueryTables(1)
.RefreshPeriod = 1 '1 minute
End With
On Error Resume Next
With Sheets("2").QueryTables(1)
.RefreshPeriod = 1 '1 minute
End With
On Error Resume Next
With Sheets("3").QueryTables(1)
.RefreshPeriod = 1 '1 minute
End With
On Error Resume Next
With Sheets("4").QueryTables(1)
.RefreshPeriod = 1 '1 minute
End With

etc...
--
I''''''''m not a looser, I keep trying€¦