Serving the Quantitative Finance Community

 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Sendkeys and Bloomberg

November 20th, 2009, 8:46 pm

But CTRL-C is expressed as^CWhat you have there is ALT-C
 
User avatar
J
Posts: 1
Joined: November 1st, 2001, 12:53 am

Sendkeys and Bloomberg

November 23rd, 2009, 3:51 am

I am courious why sendkey is important. just courious!
 
User avatar
weaves
Posts: 0
Joined: August 20th, 2004, 1:54 pm

Sendkeys and Bloomberg

November 23rd, 2009, 11:03 am

This seems to work, but it is fiddly. I have some tickers on my Excel sheet and I want to get the DES page and paste that in.There is a Bloomberg sample sheet 1039652.xls which shows how to use the DDE server directly.I've found that if you use Application.SendKeys to talk to Bloomberg to find the ticker, and then send a "DES", you can use the DDE server to make a copy to the clipboard with the key sequence "<alt->c<alt->". And then sleep for 2000 and you should be able paste special.I found that I had to use a DataObject and then GetFromClipboard.I could go into more detail, but it is fiddly.
 
User avatar
weaves
Posts: 0
Joined: August 20th, 2004, 1:54 pm

Sendkeys and Bloomberg

November 23rd, 2009, 11:04 am

The manual page on SendKey says that "^c" is Control-C and the "%c" is Alt-C.Neither works. I did find a way of doing with the DDE server.
 
User avatar
weaves
Posts: 0
Joined: August 20th, 2004, 1:54 pm

Sendkeys and Bloomberg

November 23rd, 2009, 11:13 am

J,About the Bloomberg console, you can get information from it in many ways. The Bloomberg Excel add-in allows you to access many defined fields via the DDE server.A lot of useful information seems to be only accessible as a sheet on the Bloomberg console itself. The only way you can obtain that is to talk the Bloomberg console. That's why I had to use Application.SendKeys from Excel. To get a copy of a sheet, you can use Alt-C, but Application.SendKeys doesn't seem to send that key sequence correctly.There are other ways of getting data from the database underlying the Bloomberg console (they have a data server, you can get a licence to get downloads from an FTP server), but getting copies of pages is only possible by using SendKeys.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Sendkeys and Bloomberg

November 24th, 2009, 8:53 am

J, there are many tasks that cannot be done though the BB APIsActually, that's not quite true...There are tasks that BB does not volunteer info on how to do, and it is easier to use an unsupported, nearly undocumented, and inherently flaky programming technique than to get them to tell you how to do it.
 
User avatar
Shilo
Posts: 0
Joined: October 14th, 2007, 1:08 pm

Sendkeys and Bloomberg

December 2nd, 2009, 11:42 pm

There is an api to communicate with the terminal. you can do all sort of things you normally do on the terminal, including <cancel> screens, tabs, shortcuts and any combinations of commands. if you are interested let me know.
 
User avatar
brbred
Posts: 8
Joined: November 20th, 2007, 3:05 pm

Sendkeys and Bloomberg

December 3rd, 2009, 11:51 am

Hi, could you give more details ?
 
User avatar
islington
Posts: 0
Joined: December 1st, 2004, 7:36 am

Sendkeys and Bloomberg

December 16th, 2009, 7:28 am

Or at least a hint of the direction we could investigate ?
 
User avatar
rhk
Posts: 0
Joined: January 15th, 2010, 2:42 pm

Sendkeys and Bloomberg

January 15th, 2010, 3:45 pm

Hi,I have a related question and thought I add to this thread instead of starting a new one...Is there a way to test via VBA or API when the Bloomberg window is open -BUT I have not logged in?Note: I do not want to test whether there is a Bloomberg window open. I want to test whether I'm logged in or not.Thank yourhk
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Sendkeys and Bloomberg

January 16th, 2010, 5:26 pm

You need the Win32 API GetPixel A surprisingly robust solution is to get the hDC for the desktop (it's just another window) and query the colour of the pixels. You only need to locate a few that are different between the logged in and disconnected state.