question

Upvotes
Accepted
0 1 0 0

I am not able to refresh the Refinitv "Download Manager" MS Excel workbook programatically

I'm trying to use your MS Excel Download Manager template to download commodity forecasts automatically. To refresh the file, I can successfully press the " Refresh All Files" vba button and it updates the sheet with the data as intended.

However, when I try and do this same task programmatically, by calling the underlying VBA macro, it doesn’t work.

I get the error message "Please upgrade Thomson Reuters Eikon Excel." which is part of Error message 91 within the "m_syncMgr = CreateSynchronizationMgr" of your VBA Excel Workbook. (please see below)


Please can you provide any advice how refreshing this Refinitiv Workbook can be done automatically and not manually? The underlying data/forecasts are also within Eikon, but they can not be accessed via the Eikon API.


eikoneikon-com-apiexcelvbaDownloadcommodities
one.png (24.3 KiB)
two.png (20.5 KiB)
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
39.2k 75 11 27

Your assumption is incorrect. While the use of the Web Service endpoints in any applications other than Excel is not supported and is strongly discouraged, just like we discourage regarding the capability exposed in the Download Manager spreadsheet as a datafeed, if you'd like to refresh the data in the Download Manager spreadsheet a couple of times a day, I don't see any problems with that.

Now I'm going to take a wild guess about what you're trying to do. I'm guessing you're trying to build some sort of a cron job (a batch file or VBS script or something) that you can assign to the Task Scheduler. This cron job creates an instance of Excel application and opens the Download Manager. Then the VBA code in Workbook_Open procedure will execute and this is how you intend to refresh the data to then save it in another file or some such. The issue you may be running into is that when you use OLE Automation to create an instance of Excel (invoke Excel.Application class), Excel will be launched without any add-ins. In this scenario you need to manage the add-ins in your code. Specifically you need to ensure Eikon Excel add-in is loaded before creating an instance of SynchronizationMgr COM object. If indeed this is what you're trying to implement, here's a couple of previous threads you may want to look at.

https://community.developers.refinitiv.com/questions/41040/eikon-com-addin.html

https://community.developers.refinitiv.com/questions/29464/launch-excel-com-add-in-with-python-win32com.html

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

Clicking Refresh All Files button in this spreadsheet runs the procedure named Refresh in ThisWorkbook module. Since you were able to update the data by clicking Refresh All Files button, we know the Refresh procedure in ThisWorkbook module executed correctly. This also means CreateSynchronizationMgr function executed successfully and returned an instance of SynchronizationMgr COM object.
I don't think I'm following how you reproduce the issue you've experienced. Did you run Workbook_Open procedure in your screenshot? If yes, for what purpose? What were you trying to achieve? It would be very helpful to know how precisely you reproduce the error. I'm also not following what you mean by "refreshing this Refinitiv Workbook automatically and not manually". If you'd like the workbook to refresh whenever you open the spreadsheet file, just add the call to Refresh procedure into Workbook_Open. If you're looking to do something else, would you mind specifying what it is?

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
0 1 0 0

Hi Alex,


Thanks for your reply. I wanted to run some code that automated the download from the Excel workbook, instead of manually opening and running the refresh macro. Doing the process manually seems to work, however automating it so the file is opened and the Refresh macro called raises an error.


Upon looking into this further, I’ve unfortunately learned that Refinitv does not want this sort of operation performed with the Download Manager and it was advised not to create such macros/ automation (please see here).

So I assume, the CreateSynchronizationMgr dll function looks for signs the update is being done by automation instead of manually and causes the error to be raised to prevent this. Is this a correct assumption, as I'm only trying to refresh Excel file once/twice a day at most?


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.

Click below to post an Idea Post Idea