question

Upvotes
Accepted
401 21 25 35

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

· Write an Answer
Upvotes
Accepted
301 13 32 38

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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