question

Upvotes
Accepted
40 1 3 2

VBA / Refresh Eikon Formulas

Hello,


I am using a VBA in file A to update prices. Those prices are found with Reuters formulas located in file B.

I open the file B as read only, refresh the formulas with the below instructions, but nothing happens and the prices dont get updated. It seems that if I open file B manually and refresh, the prices update correctly.

"

Application.Run "PLRefreshAllEventHandler"

Calculate

"


Any suggestion how to solve this?


Thanks in advance.

eikoneikon-com-apiexcelvba
icon clock
10 |1500

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

Upvotes
Accepted
40 1 3 2

Hello I found the answer:


DoEvents

Application.Run "EikonRefreshWorkbook", True, 120000

DoEvents

Thanks

icon clock
10 |1500

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

Upvotes
39.2k 75 11 27

I'm not reproducing the behavior you describe on my end. I just created two spreadsheets: one named Test2.xlsx containing =TR function retrieving some fast updating market data (to easily detect if the data has been refreshed), the other containing a VBA procedure with two lines of code:

Workbooks.Open "Test2.xlsx", , True
Application.Run "PLRefreshAllEventHandler"

I put Excel in manual calc mode. When I execute the above code I see Test2.xlsx being opened, and =TR function refreshing the data. If I comment out the last line of code, then Test2.xlsx gets opened with the data that was there at the time the spreadsheet was last saved (i.e. the data does not get refreshed). Long story short, my experience is exactly the expected behavior.

What is different in your case? Can you try replicating the issue using simple test files? And if you're able to replicate the behavior you experienced, can you post the exact replication procedure?

icon clock
10 |1500

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

Thanks,

On my side as the eikon formulas are complicated (sometimes need to be refreshed more than once to get the correct result), the simple instruction, doesnt work all the time. I would need an instruction that makes sure that the refresh has been correclty performed. Any idea ?

example of formula:


=OpCalcDeriv('Parameters Live'!$B$2,$K2,$G2,$C2,$W2,$M2,0,$B2&" EXM:AMER UI:FUT",,"CMT:FORM FT:BS","RET:A5 LAY:H")

@emmanuel.chaslin

Old threads with accepted answers are not monitored by forum moderatos. When asking a new question, always start a new thread. if you need to refer to an old thread, include the link to the old thread in your post.
There's no magic bullet that can ensure that all the software involved in the workflow process you've implemented functions as you'd expect.
The OpCalcDeriv function you mentioned is a pure calculation function. It does not retrieve any data. It merely takes the data provided as inputs to the function, performs calculations and returns the result. Recalculating the function is simply the matter of recalculating the range in the worksheet occupied by the function. This is where you get into the intricacies of managing Excel recalculation and issues like Excel recalculation tree becoming corrupt and requiring a rebuild. Diagnosing and addressing such problems is a very complicated matter. To get a flavor of how Excel calculation is managed at a high level and the techniques you may utilize in addition to what was previously discussed on this thread, see Microsoft article titled "Excel Recalculation". See also the discussion on this thread for details about commands you can use to refresh data retrieval functions provided by Eikon Excel.

Thanks a lot for your answer Alex, good point the problem is not coming from data loading formulas but from eikon calculation formulas, will see what I can do from that.

Click below to post an Idea Post Idea