question

Upvotes
Accepted
1 0 0 1

Refresh DSGRID functions in excel from VBA sub and wait for refresh to be finished before continuing with the code execution

Dear all,

We have developed a portfolio optimisation code that runs with VBA over one excel file that is in practice a support database.

The code loops through several non linear weighting scenarios to arrive to an optimum portfolio configuration.

During these processes the system does not need to refresh data from DS as an initial download is made before running the code.

But once the stock selection is finished, we need to update several DSGRID cells related to the selected stocks before continuing some further code lines.

We are currently using this instruction for the intermediate refresh:

Application.COMAddIns("PowerlinkCOMAddIn.COMAddIn").Object.RefreshActiveWorkbook

Despite it seems to be working, we do not know why or if other instructions would be better

We have used other instructions

Application.Run "PLRefreshWorkbookEventHandler"

And

Application.Run "EikonRefreshWorkbook"

The problem is that we are not sure which is the proper refresh system as we need synchronous refresh (sequential), meaning the VBA code temporarily stops execution until all refreshes are finished.

could you help us to clarify this issue?

Thank you very much in advance

Ivan

eikon-com-apidatastream-apidsws-apivba
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.

Hi @ivan47

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.
Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
681 2 2 1

Hi, This is regarding the the excel addin and not DSWS the API. You can raise these requests over the helpdesk. In the meantime for your reference datastream-dfo-vba-commands-vs4.pdf may help

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.