Click here to Skip to main content
13,252,537 members (58,863 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 7 Sep 2012

Gathering Bloomberg Data with Synchronous VBA Calls to the API

, 4 Oct 2012
Rate this:
Please Sign up or sign in to vote.
This article illustrates the simplest possible way of retrieving data from Bloomberg via the VBA API.


Developers often need to retrieve data from Bloomberg programmatically. Bloomberg has provided examples of how to do this, but I found that these were too verbose. The following code is a short and simple demonstration of how to acquire data from Bloomberg 

Using the code 

Before you enter this code into your VBA, make sure that you add a Reference to the ‘Bloomberg Data Type Library’.

Public Sub BloombergExample()
    Dim bbgDataControl As New BLP_DATA_CTRLLib.BlpData
    Dim price As Variant
    price = bbgDataControl.BLPSubscribe("IBM US Equity", "PX LAST")
    Debug.Print price(0, 0)
End Sub

The first parameter in the call to BLPSubscribe is the mnemonic or ‘ticker’, and the second parameter is the field that you want data for. The BLPSubscribe function has more parameters to cater for other situations. 

Points of iterest

One thing to bear in mind is that this is a synchronous call to Bloomberg, so your program will halt until you get some response from Bloomberg.

The Bloomberg API is extensive and can cater for most requirements. Hopefully this article gave you a simple base from which to increase your knowledge of the API.

To find out more about the Bloomberg API, go to <WAPI> on your Bloomberg Terminal. 


Initial article.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Chris Spicer
CEO Technicana
United Kingdom United Kingdom
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...


Comments and Discussions

QuestionBLPSubscribe equivalent in COM v3.5 library Pin
Member 1202329930-Sep-15 6:22
memberMember 1202329930-Sep-15 6:22 
QuestionBLP_DATA_CTRLLib.BlpData Pin
mcc131217-Feb-13 1:49
membermcc131217-Feb-13 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 4 Oct 2012
Article Copyright 2012 by Chris Spicer
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid