COM Interface and excel

Please post any questions regarding the program here.

Moderator: 2020vision

COM Interface and excel

Postby Graham » Tue Jul 24, 2012 10:11 am

I'm about to have a go at using the COM interface with excel, very new to it and a lot to learn so this may seem like a stupid question.

Is it only possible to have one tab connected in only one instance of BA enabled on one machine at once? I have tried linking to Gary's GetMarketDepthExample, and I can do so successfully in one tab in one instance of BA, but if I open a second instance of BA, i cannot connect to the COM interface.

Thanks, and apologies if I am being thick!
Graham
 
Posts: 130
Joined: Thu Jan 27, 2011 10:25 am

Postby GaryRussell » Tue Jul 24, 2012 10:20 am

It only works with one instance of BA, but you can have multiple tabs open.

So in our example you could create another worksheet and copy the code from the first worksheet. You will then need to add a further line of code to each worksheet to tell it which tab page in BA to communicate with.

You need to replace the following code
Code: Select all
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
        End If

with
Code: Select all
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
            ba.tabIndex = 0
        End If

tabIndex is zero based therefore the second tab page is 1 etc.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby Graham » Tue Jul 24, 2012 11:20 am

Thanks Gary, at least now I know what I am trying to do is possible. Whether or not I can implement it remains to be seen!

Regards,

Graham
Graham
 
Posts: 130
Joined: Thu Jan 27, 2011 10:25 am

Postby Graham » Thu Jul 26, 2012 12:04 pm

GaryRussell wrote:It only works with one instance of BA, but you can have multiple tabs open.

So in our example you could create another worksheet and copy the code from the first worksheet. You will then need to add a further line of code to each worksheet to tell it which tab page in BA to communicate with.

You need to replace the following code
Code: Select all
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
        End If

with
Code: Select all
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
            ba.tabIndex = 0
        End If

tabIndex is zero based therefore the second tab page is 1 etc.


Sorry, another question, I can only get this to work if the same market is open in each tab, should it work with different markets?

Thanks

Graham
Graham
 
Posts: 130
Joined: Thu Jan 27, 2011 10:25 am

Postby GaryRussell » Thu Jul 26, 2012 1:25 pm

It should work with different markets. If you send your spreadsheet to admin@gruss-software.co.uk I can take a look for you.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby Graham » Thu Jul 26, 2012 4:15 pm

Thanks Gary, I don't have a working spreadsheet as I am still trying to get to grips with the COM interface and what I can do with it. All I have done is used two copies of your getmarketdepth example, and inserted The following in the first copy
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
            ba.tabIndex = 0
        End If

And in the second copy:

Code:
        If ba Is Nothing Then
            Set ba = New BettingAssistantCom.ComClass
            ba.tabIndex = 1
        End If

Then used the multiple sheets quick link.

The first tab links correctly, but unfortunately the second tab only links when the first tab has the same market.

Hope that makes sense, I am happy to forward you the log in details of a server with this set up if it's any help.

Thanks again,

Graham
Graham
 
Posts: 130
Joined: Thu Jan 27, 2011 10:25 am


Return to Help

Who is online

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