Jeweller89
Jeweller89

Reputation: 19

Bloomberg API reference

I have the following code which works fine with Excel 2010 but due to updated API by Bloomberg this code will not work in Excel 2016. The reference BLP_DATA_CTRLLib.BlpData is outdated but I struggle to use the new API reference.

Does anyone know how do update my Bloomberg reference in order to store the quotes?

Function Get_BBG_Price(dataa As Variant, CISI As Long)

    Dim ReqSecurities As Variant, vtResult As Variant, ReqFields As Variant
    Dim Arraystr As String
    Dim oBlp As BLP_DATA_CTRLLib.BlpData

    ReDim ReqSecurities(1 To UBound(dataa, 1))

    For i = 1 To UBound(dataa, 1)

        ReqSecurities(i) = dataa(i, CISI) & "@IEHY ISIN" '  

    Next i

    Set oBlp = New BlpData

   '
   ReqFields = Array("PX_BID")

   With oBlp
       .SubscriptionMode = ByRequest
       .Subscribe ReqSecurities, 1, ReqFields, , , vtResult
   End With

   Get_BBG_Price = vtResult

End Function

Upvotes: 1

Views: 7317

Answers (1)

Jimmy Smith
Jimmy Smith

Reputation: 2451

I was taking a look and it looks like this version of the coding is deprecated. I would figure you get errors along the line of "cannot create object", but it may be hiding that in 2016.

You'd likely want to use the C# version they have here, https://www.bloomberglabs.com/api/libraries/

To put it to use, I would use the code here, http://mikejuniperhill.blogspot.com/2013/06/bloomberg-v3com-api-wrapper-update-for.html *The code is too lengthy or I'd post it here.

Upvotes: 1

Related Questions