COM - ba.placebets no longer working in new version?

Please post any questions regarding the program here.

Moderator: 2020vision

COM - ba.placebets no longer working in new version?

Postby BFDon » Thu Feb 06, 2025 10:21 pm

I tried running an old spreadsheet today on my PC and the COM ba.placebets function wouldn't fire in Gruss. Updated to the latest Version 1.3.2.8o and it still wouldn't. So I checked against my laptop which was running Version 1.3.2.6g and the command was working normally. Updated it to Version 1.3.2.8o and it stopped working. Rolled back my desktop to Version 1.3.2.6g and it was working again. Placebet command working as normal in both
BFDon
 
Posts: 17
Joined: Fri Apr 28, 2017 1:46 pm

Re: COM - ba.placebets no longer working in new version?

Postby GaryRussell » Fri Feb 07, 2025 6:45 am

You sometimes have to edit your code to force it to reference the dll correctly. In your code you will have something like
Code: Select all
Private WithEvents ba As BettingAssistantCom.ComClass
. Remove all references like this and re-enter them.
User avatar
GaryRussell
Site Admin
 
Posts: 9867
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Re: COM - ba.placebets no longer working in new version?

Postby BFDon » Fri Feb 07, 2025 10:36 am

Thanks Gary, didn't actually have any references that matched withevents on my sheet, had a Public ba As BettingAssistantCom.ComClass which i deleted, re-enetered, saved etc but no luck.

I tried the following simple code in a brand new sheet (with com references setup)

Code: Select all
Dim WithEvents ba As BettingAssistantCom.ComClass


Private Sub Example()

    'Setup array for 60 bets
    Dim refs() As String
    Dim selecIds(59) As Long
    Dim betTypes(59) As String
    Dim odds(59) As Double
    Dim stake(59) As Double
    Dim tokens(59) As String
   
    If ba Is Nothing Then
        Set ba = New BettingAssistantCom.ComClass
        ba.keepbettype = 1
        ba.tabIndex = 0
    End If
   
    'Example 3 bets only on same selection (selecId 0 = row 5)
    selecIds(0) = 0
    selecIds(1) = 0
    selecIds(2) = 0
   
    betTypes(0) = "B"
    betTypes(1) = "B"
    betTypes(2) = "B"
   
    odds(0) = 500
    odds(1) = 600
    odds(2) = 700
   
    stake(0) = 2
    stake(1) = 2
    stake(2) = 2
   
    tokens(0) = "test1"
    tokens(1) = "test2"
    tokens(2) = "test3"
   
    refs = ba.placeBets(selecIds, betTypes, odds, stake, False, tokens) 'async
    refs = ba.placeBets(selecIds, betTypes, odds, stake, True, tokens) 'sync

End Sub




Private Sub ba_pricesUpdated()
    prices = ba.getPrices
    i = 4
    For Each priceItem In prices
        i = i + 1
        Cells(i, 1).Value = priceItem.Selection
        Cells(i, 2).Value = priceItem.backOdds1
        Cells(i, 3).Value = priceItem.layOdds1
        Cells(i, 4).Value = priceItem.lastMatched
        Cells(i, 5).Value = priceItem.totalMatched
    Next
   

End Sub


The placebets doesn't fire. COM is connected because the pricesupated routine runs
BFDon
 
Posts: 17
Joined: Fri Apr 28, 2017 1:46 pm

Re: COM - ba.placebets no longer working in new version?

Postby GaryRussell » Fri Feb 07, 2025 11:43 am

In your example there is no call to the Example sub so it will never run. Are you running Example with the start debugging button to test it? I will try the same.
User avatar
GaryRussell
Site Admin
 
Posts: 9867
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Re: COM - ba.placebets no longer working in new version?

Postby GaryRussell » Fri Feb 07, 2025 11:53 am

It expects your array size to match the number of bets you have provided parameters for. Change the Dim statements to the following. I tested this and it works.

Code: Select all
    Dim selecIds(2) As Long
    Dim betTypes(2) As String
    Dim odds(2) As Double
    Dim stake(2) As Double
    Dim tokens(2) As String
User avatar
GaryRussell
Site Admin
 
Posts: 9867
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Re: COM - ba.placebets no longer working in new version?

Postby BFDon » Fri Feb 07, 2025 6:05 pm

Ok yes that worked, I have updated my old sheet so that the arrays are the correct length when fired and now it works with the new version. Thanks for the help
BFDon
 
Posts: 17
Joined: Fri Apr 28, 2017 1:46 pm


Return to Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 42 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.