2017-01-22 107 views
0

我遇到了在VBA运行时彭博公式不能加载的问题。我想用BloombergUI来解决它。Excel/VBA - 如何使用BloombergUI。订阅拉BDS?

Colin Legg的回复here适用于拉动BDP数据,但我无法让它适用于BDS公式。有人知道如何修改代码吗?

Dim xlCalc As XlCalculation Sub Test1() 
    'early bound - reference to Bloomberg 

    'save the calculation setting and then set to automatic 
    xlCalc = Application.Calculation 
    Application.Calculation = xlCalculationAutomatic 

    Sheet1.Range("C2:H4").Formula = "=BDP($B2,C$1)" 
    BloombergUI.RefreshAllStaticData 
    Application.OnTime Now + TimeValue("00:00:02"), "HardCode" End Sub Sub HardCode() 
    Sheet1.Range("C2:H4").Value = Sheet1.Range("C2:H4").Value 
    Application.Calculation = xlCalc End Sub 

回答