question

Upvotes
Accepted
1 1 0 0

RSearch function in VBA code doesn't populate data

Hi,

I am trying to execute a VBA code which is as follows. the list of securities is not coming post the EikonRefreshWorksheet command - however, when i close and re-open my workbook (or file) - the formula automatically gets applied and the list of securities get populated. but, if i run it through a macro - the refresh doesn't happen, although the timestamp associated to the Rsearch function does get changed.


"

Set Crisil = ThisWorkbook.Worksheets("Issue Rating(Crisil)") -- Issue Rating(Crisil) is a worksheet in my active workbook

Crisil.Range("A6").Formula = "=RSearch(""BOND"",""RawContextFilter:'(DbType eq \'GOVT\' or DbType eq \'CORP\' or DbType eq \'AGNC\' or DbType eq \'OMUN\' or DbType eq \'OTHR\') and IsActive eq true' ParentOrgID:'""&$B$3&""'"",,""TRANSPOSE:YES"",D6)"

Application.Run "EikonRefreshWorksheet"


Any suggestions as to where i might be going wrong here?

eikoneikon-com-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.

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 11 27

I do not reproduce the issue as described. There's probably quite a number of very specific conditions that result in the behavior you experienced. One way to deal with this is try to isolate those conditions. Feel free to post your workbook here. Try to simplify it as much as possible while ensuring you can still reproduce the problem. I will then see if I can reproduce the behavior you experience on my end.
Alternatively you may want to consider using RSearch COM library instead of =RSearch worksheet function, which will allow you to access search results from VBA code without the need to paste them in an Excel range. This gives you more control over the flow. Follow the link below for a tutorial on RSearch COM library.

https://developers.refinitiv.com/eikon-apis/com-apis-use-microsoft-office/learning?content=3560&type=learning_material_item

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.