dedalus_rex
dedalus_rex

Reputation: 469

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?

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

Upvotes: 3

Views: 6410

Answers (1)

assylias
assylias

Reputation: 328598

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).

Upvotes: 2

Related Questions