COM betStatus

Please post any questions regarding the program here.

Moderator: 2020vision

Postby Bid » Fri Jan 08, 2010 12:03 pm

It's defintely the getbet statement that is taking up the time. I've been testing with using it on it's own with a known betID.

Something like this:

Code: Select all
Option Explicit

Dim ba As New BettingAssistantCom.ComClass

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Bet As Object
    Dim betStatus As String
    Dim requestedSize As Double
    Dim matchedSize As Double

        Set Bet = ba.getbet("99999999")
        betStatus = Bet.betStatus
        requestedSize = Bet.requestedSize
        matchedSize = Bet.matchedSize

    Debug.Print Time & " ID: " & tmpBetID & " Status: " & betStatus & " Requested: " & requestedSize & " Matched: " & matchedSize
End Sub


Would declaring Bet as type Object have anything to do with it?
Bid
 
Posts: 74
Joined: Mon Oct 15, 2007 10:58 am

Postby GaryRussell » Fri Jan 08, 2010 12:10 pm

The first time the COM object is used the response time is longer. Make sure that BettingAssistantCom.ComClass is only instantiated once. Is your PlaceBet sub in a separate module with it's own instance of BettingAssistantCom.ComClass? It would be better if you had the following statement in one module only so that every call uses this instance.

Code: Select all
public ba As New BettingAssistantCom.ComClass


Does this help?
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby GaryRussell » Fri Jan 08, 2010 12:11 pm

Bid wrote:It's defintely the getbet statement that is taking up the time. I've been testing with using it on it's own with a known betID.

Something like this:

Code: Select all
Option Explicit

Dim ba As New BettingAssistantCom.ComClass

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Bet As Object
    Dim betStatus As String
    Dim requestedSize As Double
    Dim matchedSize As Double

        Set Bet = ba.getbet("99999999")
        betStatus = Bet.betStatus
        requestedSize = Bet.requestedSize
        matchedSize = Bet.matchedSize

    Debug.Print Time & " ID: " & tmpBetID & " Status: " & betStatus & " Requested: " & requestedSize & " Matched: " & matchedSize
End Sub


Would declaring Bet as type Object have anything to do with it?


In the above example is it the same if you run it multiple times?
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby Bid » Fri Jan 08, 2010 12:40 pm

You're right, the first time it runs it takes a while, then subsequently it's pretty quick. I was only really once in my testing as I was stepping through the code trying to work out where it was failing.

This is fine for my needs as this part of my code doesn't need to run very often.

Thanks for all your help - I think my system is actually ready to go fully automated now so it's time to make some money!
Bid
 
Posts: 74
Joined: Mon Oct 15, 2007 10:58 am

Previous

Return to Help

Who is online

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