VBA:等待彭博社BDP通话完成 [英] VBA: Waiting for Bloomberg BDP calls to finish

查看:269
本文介绍了VBA:等待彭博社BDP通话完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本将一些外部数据导入到工作表中,这反过来影响一些 = BDP(...)公式。最好,复制数据后,我想对BDP的结果进行一些检查。



Bloomberg Excel加载项异步更新 - 如何等待结果,然后恢复脚本?看来结果只在VBA脚本完成之后导入,无论运行多长时间。



提前感谢
Martin

解决方案

我使用BDH构建了类似的东西。我不得不释放控制权,以便Bloomberg加载项可以去收集数据,然后恢复我的代码。我可以使用Application.OnTime来做到这一点。



例如,如果您有一个影响= BDP调用的CheckForData函数,另一个称为ProcessData的函数会检查结果,则进行异步调用在'CheckForData'中的'ProcessData',例如

  Sub CheckForData 
'您的代码在这里
应用程序。 OnTime Now + TimeValue(00:00:05),ProcessData
End Sub

然后在'ProcessData'中执行检查。


I have a script that imports some external data into the worksheet, which in turn affects some =BDP(...) formulas. Optimally, I'd like to do some checks on the BDP results immidiately after copying the data.

The Bloomberg Excel Add-in updates asynchronously - how do I wait for the results and then resume the script? It seems that the results are only imported after the VBA script finishes, no matter how long it runs.

Thanks in advance Martin

解决方案

I built something similar using BDH. I had to release control so that the Bloomberg add-in can go and collect the data, then resume my code. I was able to do this using Application.OnTime.

For example, if you have a 'CheckForData' function that affects the =BDP calls, and another function called 'ProcessData' that checks the results, make an aynchronous call to to 'ProcessData' within 'CheckForData', e.g.

Sub CheckForData
  ' Your code here
  Application.OnTime Now + TimeValue("00:00:05"), "ProcessData"
End Sub

Then within 'ProcessData' perform your checks.

这篇关于VBA:等待彭博社BDP通话完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆