For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
0 1 0 4

VBA - RHistory events cancelled by MsgBox

Hello, i notice that events "OnImage" and "OnUpdate" are not triggered if a MsgBox is used right after RHistoryQuery.Subscribe. Did you know about this issue ? How can i solve this problem ?

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apieikon-com-apivbaupdate-message
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.

Upvote
Accepted
4.6k 26 7 22

RHistory API gets the data asynchronously, so if you block the execution of the current thread with the MsgBox, the fired event will be missed. I think you will see same behaviour with any async API.

I suggest either queuing the 'Subscribe' call after the MsgBox call, or refrain from using MsgBox at all.

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.

Upvote
39.3k 77 11 27

To add to the answer by @Zhenya Kovalyov, as an alternative to VBA message box, which is modal and which blocks the execution thread, you can use Win API message box where you can control the modality. Attached is a quick example.nonmodalmessagebox.zip


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.

Upvotes
0 1 0 4

Hello thanks both for your answers.

I found an other alternative -> I set the request frequency to 1 seconde.

The event OnUpdate will be trigerred every 1 seconde. So, even if a MsgBox block the execution, the event will still be called right after the end of the MsgBox.

To avoid multiple execution, i also cancel the request in the event OnUpdate.

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.

@francois.binot
From what you're saying it seems that your goal is to retrieve the timeseries once after the request and not to receive any subsequent updates to the timeseries, right? If this is the case you can use "FRQ:SNAP" in RefreshParams property of RHistoryQuery object. Then you will not need to cancel the request after you receive the initial image nor to handle OnUpdate event at all. The timeseries will be delivered into OnImage event as a snapshot. And OnUpdate event will never be raised.