Refresh Web Link in EXCEL

Please post any questions regarding the program here.

Moderator: 2020vision

Refresh Web Link in EXCEL

Postby thunderfoot » Fri Jan 06, 2006 9:47 pm

I've linked 2 tables from the Web using EXCEL's Data/Get External Data/New Web Query to the worksheet that BA is downloading data too. I've put them on the same worksheet as I thought it would make coding easier, however, I would prefer to have the 2 tables going to their own worksheets, say, Sheet 2 & Sheet 3, Sheet 1 being where the BA data is downloaded too.

Individually these 2 tables can be refreshed by right-clicking in them and selecting Refresh Data.

I want these tables to be automatically refreshed everytime BA refresh's it's data on the worksheet. I have the following code in the Worksheet that BA is downloading it's data too:
Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Range("DataChange")) Is Nothing Then
    MyMacro
    End If
End Sub

..which basically operates a Macro Module ('MyMacro') everytime the BA data changes.

What code would the 'experts' suggest I use to make the 2 tables refresh everytime the BA data refresh's? Add code to the above or add code to the Macro Module?
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby Mitch » Fri Jan 06, 2006 11:09 pm

I'd write a new macro and call it from the above code.

As for what the code should be, easiest way is to use the macro recorder.
User avatar
Mitch
 
Posts: 365
Joined: Sat Nov 19, 2005 12:28 am
Location: Leicester

Postby Ian » Sat Jan 07, 2006 6:44 pm

You could have a problem refreshing the web query every time BA updates. If you have the BA refresh every second it may take longer than 1 sec for the web queries to refresh and, then, you are sending another one before the previous one is finished. I've had problems with the screen freezing in the past.
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby mrclox » Thu Jan 12, 2006 4:26 pm

Private Sub Worksheet_Calculate()
If Range("a50").Value > 200 Then
Application.EnableEvents = False
my macro
Application.EnableEvents = True
End If
End Sub



then make cell a50 > 200 using formulas based on =now() or the ba time, i have mine triggered when the race has 20 secs till start
mrclox
 
Posts: 32
Joined: Sat Nov 19, 2005 11:00 am

Postby Mitch » Thu Jan 12, 2006 7:55 pm

How about creating a new macro and using Application.Ontime to refresh the table at safe intervals.
User avatar
Mitch
 
Posts: 365
Joined: Sat Nov 19, 2005 12:28 am
Location: Leicester

Postby GeorgeUK » Sat Jan 14, 2006 10:56 pm

Just noticed this.

If you rightclick within the webquery data, one of the options is Data range properties
this will refresh at most, once per min.

With Selection.QueryTable
.RefreshPeriod = 1

not sure if there is a way to playaround with this.
previously known as Gaseous (on the betfair forum)
User avatar
GeorgeUK
 
Posts: 315
Joined: Sat Nov 19, 2005 10:18 pm
Location: Scotland


Return to Help

Who is online

Users browsing this forum: No registered users and 21 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.