Search code examples
vbaexcelbloomberg

Retrieving IOI Data From Bloomberg


I'm trying to pull real time indication of interest data out of bloomberg and into excel. I cannot find a way to do it via the Excel API so I am considering two options:

  1. Some messy VBA API calls to try and pull it out.

  2. Taking control of the bloomberg gui using VBA and opening the page.

Does anyone know if either of these are even possible? I can see the latter working with some real serious bodge work with the windows functions and sendkeys but idealy there will be a propper way hidden amongst the many VB libraries.

Thanks,


Solution

  • In case anyone ends up searching this - I ended up using VBA to control the main Bloomberg Terminal. The below takes the screen no to change and the command to pass to the terminal. It is reading the ticker from the active cell.

    Private Sub Change_Screen(ScreenNo As Byte, QueryString As String)
    
        Dim Blp As Long
    
        'Establish connection with terminal via add-in.
        Blp = DDEInitiate("winblp", "bbk")
    
        'Call add in - make the gui go to the IOI page for security currently selected using the screen select.
        Call DDEExecute(Blp, "<blp-" & ScreenNo - 1 & ">" & ActiveCell.Text & "<equity>" & QueryString & "<GO>")
    
        'Kill terminal connection.
        Call DDETerminate(Blp)
    
    End Sub