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

any other ideas out there, if you want i can e-mail you a copy of a
sheet with the web query on it, and the ideal would be to try get it so
when the error pops up it kills it then refreshes and loops until data
is retrieved.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Web Query Query

TB

If you refresh in the foreground, you will get a trappable error. Use
syntax like

Sheet1.QueryTables(1).Refresh Background:=False

If there is no data, you will get Run Time Error 1004. No put in the
appropriate On Error statment and you should be able to continue processing
when the web page returns no data. Note that refreshing the foreground will
dramatically slow the time it takes for the code to run, but not necessarily
the time it takes for the whole operation to complete.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

wrote:
any other ideas out there, if you want i can e-mail you a copy of a
sheet with the web query on it, and the ideal would be to try get it
so when the error pops up it kills it then refreshes and loops until
data is retrieved.




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

Hi thankyou so much for your reply if what you say works that will end
months of getting no where!
im very sorry but i am kinda new to excel so is it possible for someone
to show me how to construct that on to a sheet? so the code
Sheet1.QueryTables(1).Refresh Background:=False then an on error
statement to trap it then a on error statement to repeat the above
steps if an error shows. (is it possible for you to put each bit in
steps so i can study it and learn it for myself? thankyou very very much

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

Sorry i dont know if what i think was an e-mail went through to you if
not here is someof what i said if so ive just finished a bit more in my
code as follows.

Sub LoopRefresh()
StartHe
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

With ThisWorkbook.Sheets("Sheet1").Cells
..QueryTable.Refresh BackgroundQuery:=False
End With

GoTo StartHere
End Sub


This makes the refresh time to be every 10 seconds... now all i need is
how to modiffy that to work with what you were talkiong about... so
instead of showwing the message no data returned... it comes up with a
error and then error traps it and restarts the refresh.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Web Query Query

Woah im getting close ive made it now so instead of the message poping
up it does a custom message box!!! which means its now possible to
close that box! :D just working on the coding now!!!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Web Query Query

The soloution to Web query returned no data message -

Public Sub Test()
Dim Qrytbl As QueryTable

For Each Qrytbl In ActiveSheet.QueryTables
On Error Resume Next
Qrytbl.Refresh False
On Error GoTo 0
Next Qrytbl
End Sub

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
Use MS Query to query data within the current work book Steve Kesler Excel Discussion (Misc queries) 0 August 6th 09 05:22 PM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


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

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

About Us

"It's about Microsoft Excel"