vba 单击 Bloomberg Ribbon 上的 RefreshWorkbook

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7660971/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 14:11:41  来源:igfitidea点击:

Click RefreshWorkbook on Bloomberg Ribbon

excelvbabloomberg

提问by pinkfloydx33

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

可能的重复:
如何在 vba 中的 excel 中刷新/加载 RTD Bloomberg 函数 (BDH)

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

我正在使用 VBA 处理 Excel 电子表格。我有一个彭博 BDH 功能,我想从 VBA 刷新。我尝试录制一个宏并单击 Bloomberg->Refresh Workbooks 按钮,但宏显示为空。我怎样才能从代码中做到这一点?我正在使用 Excel 2007,我找到了一种输入选项

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.

Application.Run "blpmain.xla!RefreshAllStaticData"
但是找不到 blpmain.xla。我不确定这是用于哪个版本的 Excel/BBG-Addin。

Any help?

有什么帮助吗?

回答by pinkfloydx33

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.

我最终做的是在适当的范围内重新粘贴彭博公式。这迫使数据重新下载。不是最理想的解决方案,但它有效。

回答by Lostsoul

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

基本上,与 BDP...BDH 不刷新,因为它的历史(H),如果你想刷新它,你需要重新提交你的公式。

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.

也许不是最优雅的解决方案,但我所做的是更改 BDH 公式中的某些内容。因此,您可以单击您制作的按钮,该按钮获取数据并添加一天,然后将其删除。这种轻微的变化会导致它刷新。

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.

我曾经做过的另一件事是让 BDH 引入所有历史数据,但在顶部列有一个 BDP 实时提要,以便它保持新鲜。

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.

最后,最简单的方法是让用户在一天结束时关闭 Excel 工作表,并让他们在需要时重新打开它。

回答by JMax

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.
  1. 在工作簿中打开要在其中使用加载项功能的代码模块
  2. 转到“工具”>“引用”以打开“引用”对话框,您将在其中看到可以设置引用的所有库和其他对象(如加载项)的列表。
  3. 在名称旁边的框中打勾,然后单击“确定”按钮。

References dialog - VBA Project

“引用”对话框 - VBA 项目

Source

来源

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

完成此操作后,您可以直接引用 xla 函数RefreshAllStaticData