Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Invalid Web Query Error

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€¦
  #2   Report Post  
Posted to microsoft.public.excel.programming
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€¦

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Invalid Web Query Error

I'm sorry, but I have very limited knlodge about VBA.
Is it possible to do it just in excel?? If not, how can add your code to my
code/spreadsheet? (my code is inside an excel VBA module and I have a
worksheet for each web query)



"Joel" wrote:

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€¦

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Invalid Web Query Error

Thanks Don, the code is ok to make it smaller.
But the "invalid web query Error" keeps bugging me.
The way I'm trying to skip the error is this but it doesn't work:

Sub setrefreshon13sheets()
Application.DisplayAlerts = False
On Error Resume Next
For i = 1 To 13
Sheets(CStr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
Next i
End Sub


"Don Guillett" wrote:

try this. UN tested. But maybe all could be on ONE query with variables
instead of 4 queries.

sub setrefreshonfoursheets
On Error Resume Next
for i=1 to 4
Sheets(cstr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
next i
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
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€¦





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Invalid Web Query Error


Send a copy of your workbook to my address below along with a snippet of
this msg in an inserted sheet and I will take a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
Thanks Don, the code is ok to make it smaller.
But the "invalid web query Error" keeps bugging me.
The way I'm trying to skip the error is this but it doesn't work:

Sub setrefreshon13sheets()
Application.DisplayAlerts = False
On Error Resume Next
For i = 1 To 13
Sheets(CStr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
Next i
End Sub


"Don Guillett" wrote:

try this. UN tested. But maybe all could be on ONE query with variables
instead of 4 queries.

sub setrefreshonfoursheets
On Error Resume Next
for i=1 to 4
Sheets(cstr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
next i
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
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€¦




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Invalid Web Query Error

This should explain it. Best to use one query and change parameters
accordingly.
http://support.microsoft.com/kb/810183

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...

Send a copy of your workbook to my address below along with a snippet of
this msg in an inserted sheet and I will take a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
Thanks Don, the code is ok to make it smaller.
But the "invalid web query Error" keeps bugging me.
The way I'm trying to skip the error is this but it doesn't work:

Sub setrefreshon13sheets()
Application.DisplayAlerts = False
On Error Resume Next
For i = 1 To 13
Sheets(CStr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
Next i
End Sub


"Don Guillett" wrote:

try this. UN tested. But maybe all could be on ONE query with variables
instead of 4 queries.

sub setrefreshonfoursheets
On Error Resume Next
for i=1 to 4
Sheets(cstr(i)).QueryTables(1).RefreshPeriod = 1 '1 minute
next i
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
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€¦




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
Invalid web query Excel 2007 Bob Excel Discussion (Misc queries) 0 June 26th 09 03:51 PM
How do I correct Query error "Invalid bracketing of name 'xls.'." Halp0o9i8 Excel Discussion (Misc queries) 0 August 22nd 08 04:52 AM
Invalid Web Query errors. YellowBird Excel Programming 2 May 30th 06 04:36 PM
"Invalid Web Query" error on opening a 2003 worksheet Linus Excel Discussion (Misc queries) 0 February 21st 06 04:55 PM
error message in Microsoft Query - ORA-00903 invalid table name bert Excel Programming 2 October 28th 04 10:06 AM


All times are GMT +1. The time now is 03:45 PM.

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

About Us

"It's about Microsoft Excel"