Lar*_*rry 7 excel vba excel-vba bloomberg
我想知道VBA代码是否有办法强制使用bloomberg函数(在电子表格中)更新其值(任何BDH函数)
目标开发人员面临类似问题/拥有彭博终端
我试过了什么 -
Application.RTD.RefreshData
Application.RTD.throttleInterval = 0
Application.CalculateFull
Run Code Online (Sandbox Code Playgroud)
BDH功能不会重新加载它们.
我现在可以刷新它们的唯一方法是:单击BloomBerg加载项功能区上的"刷新工作簿"按钮.
由于Bloomberg加载项在VBE中被锁定,我无法找到必要的代码.我错过了任何彭博参考吗?任何彭博专家/用户都能指出我正确的方向吗?谢谢.
小智 8
我最近从 bbg 聊天中收到了这个答案。我想这就是我们都在寻找的......
bbg 帮助台:通常我们不会在帮助台上提供有关 VBA 的帮助,但我找到了以下内容。您可以使用以下 VBA 命令刷新 BDx() 公式:
Refresh based on default option setting: Application.Run "RefreshData"
Refresh current selection: Application.Run "RefreshCurrentSelection"
Refresh current worksheet: Application.Run "RefreshEntireWorksheet"
Refresh current workbook: Application.Run "RefreshEntireWorkbook"
Refresh all workbooks: Application.Run "RefreshAllWorkbooks"
Run Code Online (Sandbox Code Playgroud)
注意:使用 VBA 宏刷新 Bloomberg 公式时,当触发刷新的宏正在运行时,公式无法完成数据请求。您必须使用 Application.OnTime() 安排第二个函数在触发刷新的子例程退出后运行。以下代码片段演示了刷新所有工作簿的 VBA 代码,然后在调用 processSheet 子例程之前延迟 10 秒:
Sub refreshSheet()
Application.Run "RefreshEntireWorksheet"
Application.OnTime (Now + TimeValue("00:00:10")), "processSheet"
End Sub
Sub processSheet()
' perform processing here
End Sub
Run Code Online (Sandbox Code Playgroud)
我通过在记事本中打开它来搜索xla中的关键字"refresh".找到了以下目标:
RefreshAllWorkbooks
blpmain.xla!RefreshAllStaticData
blpmain.xla!'RefreshWorkbookFundamentalsData
blp.xla!IsBlpRefreshAvailable
Run Code Online (Sandbox Code Playgroud)
我逐个尝试了它们,前两个通过调用:
Application.run "RefreshAllWorkbooks"
Application.run "RefreshAllStaticData"
Run Code Online (Sandbox Code Playgroud)
但不要单独调用它们(我想这是因为我可以使用Application.run调用受保护的PUBLIC过程)
RefreshAllWorkbooks
Run Code Online (Sandbox Code Playgroud)
要么
RefreshAllStaticData
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
| 归档时间: |
|
| 查看次数: |
62268 次 |
| 最近记录: |