macduss


Hi All,

i am building a macro in which i retrieve info from Bloomberg.

i have to compare these data with other values.

Before comparing i would like to copy and paste special value the data retrieved from bloomberg.

How can i do to perform the copy paste special value only once all fields are updated (i.e. how the macro can know that the fields are ok and it is time to copy and paste )

Thnaks a lot




Re: VBA + Bloomberg

Luiz Cláudio - MVP


If you're building a macro to retrieve data, you can add the code that will paste special in the same macro.







Re: VBA + Bloomberg

macduss

ok but it takes some time to retrieve the Bloomberg data. How will the macro know that everything has been updated at 100% and then it can be copied and pasted

that's my main issue






Re: VBA + Bloomberg

Luiz Cláudio - MVP

When you debug, does your code continue to run while the Bloomberg data is requested or it stops at the Invoke line






Re: VBA + Bloomberg

Joe Dawson

You can pull the bloomberg data in with VBA code via an array and then paste it to the spreadsheet. A guy at work uses this method. I will try to remember to ask him for the code so I can paste it in here on Wednesday. If I forget you can use the HELP HELP function to contact the Bloomberg tech support rubes and hope they can get you to someone who can send you the code.


I have a spreadsheet that sucks a bunch of data in from Bloomberg and I have it set to turn the calculation off when it opens. Then, to update the Bloomberg links I turn automatic calculation on and wait for it to run its course. I suppose you could tell your macro to wait for 10 seconds or so before it runs, but that is not a guarantee. Pulling the data directly in using VBA is probably the most robust method.

I will paste some code tomorrow.




Re: VBA + Bloomberg

Joe Dawson

Hi,

My coworker forwarded me this from Bloomberg. He also sent me a file with an example, but I dont think we can post files here. This is the solution to your problem. My coworker also told me that using a pause in your VBA code to wait for bloomberg links in cells to update will pause the updating of the cells as well as the code, so that is a dead end. Hope this helps.

From Bloomberg:
You could use some of our existing samples and modify them as per your needs.
On WAPI<GO> search for "sdkdownldcenter" and download the Bloomberg Desktop API
SDk's. Once installed you can find them at C:\blp\API\Ad Hoc Examples\ActiveX
Data Control. The SimpleSynchronous sample would be a great place to start.
Also if you dont want to have a button, you could replace it with a macro that
makes the synchronous request.