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)"
Any suggestions as to where i might be going wrong here?
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.