Results 1 to 2 of 2
  1. #1
    ballybeg is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Canberra Australia
    Posts
    6

    Angry Expose object sub array values from vb.net com add in

    I am sure this is a common issue, but extensive searches leave me still stuck.

    I have a vb.net com add in that successfully returns an object - RaceBook that is a Custom BetFair object. The Racebook contains race data and an array of runners data, and the values are easily exposed within vb.net:

    However when I use the same request in VBA I get an "incorrect number of arguments" error.
    Code:
    Public Function fngetPrices()
    Dim strMarketID As String
    strMarketID = "2.101063980"
    Dim RaceBook As ApiNgClassLib.MarketBook
    Set oBetfairLib = New ApiNgClassLib.CreateApiCalls
    Set RaceBook = oBetfairLib.fngetPrices(strMarketID)
    Debug.Print RaceBook.marketid ' works fine
    Debug.Print RaceBook.status ' works fine
    Debug.Print RaceBook.runners(0).selectionid ' error 450 wrong number of arguments
    End Function
    here is a subset of the Racebook - you can see runners 1 - 3 listed here

    MarketBook : MarketId=2.101063980 : Status=CLOSED : BetDelay=1 : Version=129707980 : Runner[0]=SelectionId=8972613 : Handicap=0 : Status=LOSER : AdjustmentFactor=12.5 : LastPriceTraded= : TotalMatched=0 : RemovalDate=: ExchangePrices : Runner[1]=SelectionId=8972614 : Handicap=0 : Status=LOSER : AdjustmentFactor=6.3 : LastPriceTraded= : TotalMatched=0 : RemovalDate=: ExchangePrices : Runner[2]=SelectionId=6749312 : Handicap=0 : Status=LOSER : AdjustmentFactor=0.5 : LastPriceTraded= : TotalMatched=0 : RemovalDate=: ExchangePrices :

    Even though the print shows Runner[0] - in vb.net it is listed as an array of runners. this works fine in vb.net:



    RaceBook.runners(0).selectionId = 8972613

    I just cannot get the data out no matter how I express it - my last resort is to parse the object - which I really do not want to do.

    All help appreciated.

    ballybeg
    Last edited by June7; 11-08-2014 at 02:41 AM.

  2. #2
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    I would try to add a reference to the library file that ApiNgClassLib.Marketbook refers to, and then use the Object Browser in Access VBE and explore the library's contents.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 11-07-2013, 11:10 AM
  2. Replies: 1
    Last Post: 07-02-2013, 08:41 AM
  3. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  4. Replies: 3
    Last Post: 11-02-2010, 10:14 AM
  5. Replies: 1
    Last Post: 08-05-2010, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums