Is there a way to get VBA to pause and wait for TR and RSearch formulas to update?

PeterG
PeterG Newcomer

Basically I am trying to write a macro that loops through a list of RIC's.

In the worksheet every time the RIC is updated, the TR and RSearch functions in there need to update, the sheet needs to recalculate and then some of the results get posted to a report that the VBA macro handles later on. My problem is that if I just let the macro run then the loop continues to the end of the list of RICs before any of the cells in the worksheet have time to update. If I pause the macro, it just sits there, and the TR and RSearch fields never get updated.

I am told that due to the asynchronous nature of the TR API, it is not possible to do this within a single macro, so I am wondering if there is some kind of workaround for this? - or do I need to let the user wait for the updates to happen, and then "manually" click a button that picks the next RIC in the list and so on?

Best Answer

  • Zhenya Kovalyov
    Answer ✓

    @PeterG, I do not believe that you can achieve this in a manner that will produce sustainable solution.

    Since you need to control the stages of execution, I suggest that you use the COM API for search (RSearch), real-time data (AdfinX Real-time), analytics (Adfin Analytics), time series (RHistory) and reference data (DEX2).

    All the tutorials can be found here.

Answers