Click RefreshWorkbook on Bloomberg Ribbon [duplica

2019-08-15 17:50发布

问题:

Possible Duplicate:
How to refresh/load RTD Bloomberg function (BDH) in excel in vba

I am working on an Excel Spreadsheet with VBA. I have a Bloomberg BDH function that I want to refresh from VBA. I tried recording a macro and clicking the Bloomberg->Refresh Workbooks button but the macro came up empty. How can I do this from code? I'm using Excel 2007 and I found one option of entering

Application.Run "blpmain.xla!RefreshAllStaticData"
but blpmain.xla can't be found. I'm not sure what version of Excel/BBG-Addin this was for.

Any help?

回答1:

What I ended up doing was re-pasting down the bloomberg formulas in the appropriate ranges. This forced the data to redownload. Not the most ideal solution but it works.



回答2:

Basically, unlike BDP...BDH doesn't refresh because its historical(H), if you want refresh it you need to resubmit your formula.

Maybe not the most elegant solution but what I do is change something in the BDH formula. So you can click on a button you make that takes the data and adds a day and then removes it back. That slight change causes it to refresh.

Another thing I used to do was have a BDH bring in all the historical data, but have the top column a BDP realtime feed so it kept freshing.

In the end, the easiest way is to have the users close the excel sheet at the end of the day and have them reopen it when they need it.



回答3:

Are you sure you've set a reference to the addin?

  1. Open a code module in the workbook in which you want to use the Add-In's functions
  2. Go to Tools > References to open the References dialog where you will see a list of all the libraries and other objects (like Add-Ins) to which you can set a reference.
  3. Put a tick in the box next to the name and click the OK button.

Source

Once you've done this, you can refer directly to the xla function RefreshAllStaticData.