Excel VBA calls Bloomberg terminal and enters a query, how do I enter the Yellow Key/ Market Sector of a security correctly in my code?

StackOverflow https://stackoverflow.com/questions/17950868

  •  04-06-2022
  •  | 
  •  

Question

Hi I'm doing something in Excel vba that when I click the button that runs the macro it enters a query in Bloomberg and brings me to a security and a function that views it.

Blp = DDEInitiate("Winblp", "bbk")
Call DDEExecute(Blp, "<Blp-1>" & "APPL US Equity" & " DES<GO>")
Call DDETerminate(ch)

Now the problem is that this query goes into Bloomberg it never detects it as a valid security. I think this is definitely a yellow button issue, i.e. if you just type APPL US Equity into Bloomberg as opposed to APPL US [Equity] with yellow button it just wont work.

Is there a special object or string that I need to enter to have this query go in correctly? I've tried to search Google but can't find anything.

Thanks

Was it helpful?

Solution

Equity is a reserved keyword like Go, you can access it with:

Blp = DDEInitiate("Winblp", "bbk")
Call DDEExecute(Blp, "<Blp-1>" & "AAPL US <EQUITY>" & " DES<GO>")
Call DDETerminate(Blp)

ps: two typos in your code:

  • APPL => AAPL (I suppose)
  • DDETerminate(ch) => DDETerminate(Blp).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top