question

Upvotes
Accepted
401 17 18 34

Why doesn't Application.Run("RtGet","IDN",RIC,FID) work in Eikon for Excel VBA?

eikoneikon-com-apiexcelvbart-get
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
301 8 22 30

In 3000Xtra/PowerPlus Pro, it was possible to call individual items of data using VBA's Application.Run, where worksheet functions can be called - as RtGet is a worksheet function data could be called, for example;

Sub myRtGet()
     Dim myRtGetVal As Variant
    
     myRtGetVal=Application.Run("RtGet","IDN","EUR=","BID")
     Do Until myRtGetVal<>"#NA NA"
          Doevents
          myRtGetVal=Application.Run("RtGet","IDN","EUR=","BID")
     Loop
     MsgBox myRtGetVal
End Sub

In Eikon for Excel this code (which has to look for the "Retrieving..." value to change, i.e. Do Until myRtGetVal<>"Retrieving...") will keep looping and will continue to return "Retrieving...". This is a result of the way that Eikon for Excel works with Microsoft's RTD (Real Time Data). By looping with the Application.RTD.RefreshData method, the data will be returned.

Sub myRtGet()
    Dim myRtGetVal As Variant
   
    myRtGetVal = Application.Run("RtGet", "IDN", "EUR=", "BID")
   
    Do Until myRtGetVal <> "Retrieving..."
        Application.RTD.RefreshData
        DoEvents
        myRtGetVal = Application.Run("RtGet", "IDN", "EUR=", "BID")
    Loop
   
    MsgBox myRtGetVal
End Sub 'NOTE - This only works with RtGet(). Using the method with RData() or RHistory(), the "Updated at hh:mm:ss" value will be returned.
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.