Moderator: 2020vision
by Shaun » Mon Sep 15, 2008 7:26 am
by Shaun » Mon Sep 15, 2008 12:54 pm
Private Sub Workbook_Open()
'Monitor the F12 key and when pressed run the ToggleRefresh procedure
Application.OnKey "{F12}", "ToggleRefresh"
'The refresh process will be off by default when the book is opened
'If you want it on then run this line below.
'Note because the RefreshOn variable is false by default and ToggleRefresh
'changes it to the opposite then RefreshOn will be changed to True and the
'RefreshQuery procedure will be called by the ToggleRefresh procedure.
Call ToggleRefresh
End Sub
'A public variable that will stay in memory while the book is open
'The value of this variable will be False by default.
'Its used as an indicator so you know whether to refresh or not in the RefreshQuery procedure
Public RefreshOn As Boolean
Public RunWhen As Double
Public Sub ToggleRefresh()
'Toggle the refresh to the opposite that it is now
'ie if its currently false then the variable will now be true and visa versa
RefreshOn = Not RefreshOn
If RefreshOn = True Then
'If RefreshOn is true you want to start the refresh process
Call RefreshQuery
MsgBox "Web Query Refreshing is ON." & vbLf & vbLf & _
"To toggle refreshing ON/OFF press the F12 key.", vbInformation, "Web Query Refresh Status"
Else
'stop the pending ontime procedure
On Error Resume Next
Application.OnTime RunWhen, "RefreshQuery", schedule:=False
On Error GoTo 0
MsgBox "Web Query Refreshing is OFF." & vbLf & vbLf & _
"To toggle refreshing ON/OFF press the F12 key.", vbInformation, "Web Query Refresh Status"
End If
End Sub
Public Sub RefreshQuery()
Dim Qrytbl As QueryTable, Sh As Worksheet
'Change this to the name of your sheet that holds the web queries
Set Sh = Sheets("Data")
For Each Qrytbl In Sh.QueryTables
'If the query isnt already refreshing then refresh it
If Not Qrytbl.Refreshing Then
On Error Resume Next
Qrytbl.refresh False
On Error GoTo 0
End If
Next Qrytbl
'Repeat this procedure every 30 seconds. The false argument should clear
'the Ontime event if its in memory ready to run (ie stop it running twice in
'quick succession). You check to see if RefreshOn is true before repeating
'the procedure again
If RefreshOn = True Then
RunWhen = Now + TimeValue("00:00:05")
On Error Resume Next
Application.OnTime RunWhen, "RefreshQuery"
On Error GoTo 0
End If
End Sub
by Ian » Mon Sep 15, 2008 2:01 pm
by Shaun » Mon Sep 15, 2008 2:54 pm
by Ian » Mon Sep 15, 2008 3:41 pm
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.