Loading next day races automatically

Please post any questions regarding the program here.

Moderator: 2020vision

Loading next day races automatically

Postby Wacom78 » Tue Aug 04, 2020 7:41 am

Can anyone help please. I have my GRUSS Set up with auto link to Excel, each days UK and Irish racing on separate tabs. My Excel sheet moves from race to race no problem.

However, each morning I have to close GRUSS and re-open to load the next days races. Can anyone help provide some VBA code to load next day races automatically at like 6am for each tab
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby tradeaj71 » Tue Aug 04, 2020 9:02 am

viewtopic.php?f=8&t=3558

Gary has given an example of how to do this, albeit at midnight each day.
Just plugging away!
tradeaj71
 
Posts: 26
Joined: Tue Nov 12, 2013 6:16 pm
Location: United Kingdom

Re: Loading next day races automatically

Postby Wacom78 » Tue Aug 04, 2020 1:31 pm

Thanks for reply, I had seen the example sheet - but don't think it works when I have multiple tabs for different courses?

For instance, today there are 4 tabs for 4 meetings, tomorrow there might be 5, then Thursday there might be 3.
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Captain Sensible » Tue Aug 04, 2020 2:03 pm

Have you tried amending Gary's example sheet and amended the -3 that's sent to Q2 with a -4 as that's the reload code you need for multiple tabs.

http://www.gruss-software.co.uk/Betting ... _other.htm
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Loading next day races automatically

Postby Captain Sensible » Tue Aug 04, 2020 2:08 pm

You'll obviously need tabs already linked to excel as it'll only fill the tabs with markets. You can use the log multiple heets link to open as many as you think may be needed and no problem if some are empty.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 8:22 am

I will give that a go thanks
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 8:25 am

I assume this code only needs to go on one sheet and not all of them?
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 8:32 am

I already have some code on each sheet under worksheet change - inserting this code gives me a "Compile Error"

Ambiguous name detected: Worksheet_Change

Should I insert this code at the end of my routine?
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Captain Sensible » Wed Aug 05, 2020 2:17 pm

You just need to incorporate the refresh routine within your current worksheet_change routine for the worksheet linked to the first tab. Just the bits

Code: Select all
        If triggerQuickPickListReload Then
            triggerQuickPickListReload = False
            Range("Q2").Value = -4
            triggerFirstMarketSelect = True
        Else
            If triggerFirstMarketSelect Then
                triggerFirstMarketSelect = False
                Range("Q2").Value = -5
            End If
        End If


And the routine to reload at 6 in your module

Code: Select all
Public triggerQuickPickListReload As Boolean
Public triggerFirstMarketSelect As Boolean

Public Sub loadQuickPickList()
    triggerQuickPickListReload = True
    Application.OnTime TimeValue("06:00:00"), "loadQuickPickList"
End Sub
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Loading next day races automatically

Postby Captain Sensible » Wed Aug 05, 2020 2:22 pm

You can write a different routine if it's easier as all you're doing is sticking -4 in Q2 to reload the markets into separate tabs and follow up with -5 in Q2 so the program moves to the first market in each quick pick list. Gary's example was just an example of how to do it but obviously if you already had coding to stick in -3 at 6am just switch that to -4.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 4:09 pm

Ok thank you - got into a right tangle and stopped my BOT by adding the new code in - I think I will set it up as a separate Macro and call it that way
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Captain Sensible » Wed Aug 05, 2020 5:06 pm

Calling a separate routine is probably the best way as you can then tweak that easier without messing up you main code.

Also Gary's code all runs originally by starting the routine using Workbook_Open() under Thisworkbook and then that simply loops itself so you'd need to include that if using Gary's method.

Code: Select all
Option Explicit

Private Sub Workbook_Open()
    Application.OnTime TimeValue("06:00:00"), "loadQuickPickList"
End Sub



Just remember that whilst the -4 refreshing the quick list only needs to be in the worksheet for the first open tab, the -5 to reload all tabs to the first market in the QPL will need to be in each worksheet
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 6:47 pm

Thanks for the feedback, will see what I can come up with and test tonight / tomorrow
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Wacom78 » Wed Aug 05, 2020 6:59 pm

I've basically used what you put here in the "ThisWorkbook" section

Code: Select all
Public triggerQuickPickListReload As Boolean
Public triggerFirstMarketSelect As Boolean

Public Sub loadQuickPickList()
    triggerQuickPickListReload = True
    Application.OnTime TimeValue("06:00:00"), "refresh"
End Sub


I have created a Macro called Refresh - which is triggered by the above - that code is below. Do you think this will work?

Code: Select all
Sub Refresh()

   If triggerQuickPickListReload Then
            triggerQuickPickListReload = False
Sheet("Sheet1").Select
            Range("Q2").Value = -4
            triggerFirstMarketSelect = True
        Else
            If triggerFirstMarketSelect Then
                triggerFirstMarketSelect = False
                Range("Q2").Value = -5
            End If
        End If

Sheet("Sheet2").Select
Range("Q2").Value = -5
Sheet("Sheet3").Select
Range("Q2").Value = -5
Sheet("Sheet4").Select
Range("Q2").Value = -5
Sheet("Sheet5").Select
Range("Q2").Value = -5
Sheet("Sheet6").Select
Range("Q2").Value = -5

End Sub
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Re: Loading next day races automatically

Postby Wacom78 » Thu Aug 06, 2020 7:56 am

That didn't work at all - back to scratching my head with this one.

I already have code in each sheet which triggers my bets and moves to the next race automatically, so I don't know how to refresh the markets at 6am as well as do what I'm already doing. Is anyone able to help how best to do this
Wacom78
 
Posts: 38
Joined: Mon Nov 04, 2019 2:32 pm

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 23 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.

cron