+ Reply to Thread
Results 1 to 2 of 2

Trouble with API

Hybrid View

  1. #1
    Registered User
    Join Date
    03-11-2012
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Trouble with API

    I wish to obtain live quotes from a broker and this is the example that they gave me.
    It works fine, However I wish to add more quotes(what I added is in bold)
    It seems it only returns the first request in both cells.

    Dim WithEvents quotes As SterlingLib.STIBook
    Dim a As Integer
    
    
    
    Private Sub CommandButton1_Click()
        Set quotes = New SterlingLib.STIBook
        Call quotes.RegisterForTopOfBookMsgs(UCase(Sheet1.Cells(2, 1)), "ARB")
        Call quotes.RegisterForTopOfBookMsgs(UCase(Sheet1.Cells(3, 1), "ARB")
    
    End Sub
    Private Sub quotes_OnSTIBookUpdate(structSTIBookUpdate As SterlingLib.structSTIBookUpdate)
                   
         Sheet1.Cells(2, 2) = structSTIBookUpdate.fPrice
         Sheet1.Cells(3, 2) = structSTIBookUpdate.fPrice
                   
    
    End Sub

  2. #2
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Trouble with API

    You are missing a parenthesis in the second call of the quotes
    Call quotes.RegisterForTopOfBookMsgs(UCase(Sheet1.Cells(3, 1)), "ARB")
    Also you will need to change the Ticker from ARB to any other valid ticker

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1