question

Upvotes
Accepted
3 0 0 3

VBA - Open Eikon Quote App Window and change template

Hi,

I'm using "reuters://REALTIME/verb=FullQuote/ric=" to open a Quote App Window from Excel (in order to make a screenshot)


My questions are :

1. I wonder how I can change the default Template applied to this quote app (directly in the Reuters:// command or through a parameter in Eikon)

2. I did not find any information on the "Reuters://REALTIME/verb=" function. What are the available parameters, .... Where can I get documentation or list of parameters of this command ?

Have a good day
Kind regards

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

Sure, here you go. In the attached example Flex Book the clock object in the top right corner is used to schedule the procedure that uses keystrokes to bring the Flex Book window to the front and take a screenshot. Then it launches MS Word, pastes the screenshot into a new document and saves it as pdf. If you're happy with taking the screenshot of Flex Book window you can use this file. Just change the RIC in the Quote, choose the display template and don't forget to set Display Template Persistent property to Yes.
If you'd like to launch a quote pop-up instead, you can use the following

Dim quotePopup As Browser
Set quotePopup = Application.Browsers.Add("Quote", Application.DefaultDatafeed & ricName)
quotePopup.Object.DisplayTemplatePersistent = True
quotePopup.Object.DisplayTemplateFile = "...full path to the template file..."

However, you'll need to figure out how to get the handle of the quote pop-up window.savequoteaspdf.zip


savequoteaspdf.zip (18.6 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
39.2k 75 11 27

I'm afraid I don't see any way to achieve what you're looking for. The hyperlinks with "reuters" protocol that you're using are a legacy interface, which is not documented for external use. There's a public API, which provides similar functionality. If you're interested in exploring it see
https://developers.refinitiv.com/en/api-catalog/eikon/side-by-side-integration
But neither of these interfaces provides capability to change display template in a pop-up Quote app. If you're looking to take the screenshot of a Quote app automatically at say a certain time every day, then you could automate that using legacy Flex Sheets and VBA in Eikon. If interested I can give you an example. But I cannot think of any way to control this process from another application such as Excel.

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

Hi Alex,

I understand and I didn't have real hopes before asking the question.

You're right, I would like to take screenshot of a Quote app 2 times a day. So if you have a way to do that through Eikon, I'm interested. I'm interested by your example.

Kind Regards

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

Due to an outage of the Thomson Reuters Developer Community email notification system from 2:30 PM CDT on November 29th until 9:00 AM CDT on November 30th we are posting to all questions updated during this timeframe in order to ensure all customers receive all relevant email updates. Please review this question, and its associated answers, in order to ensure you are aware of any possible updates that may have occurred during this outage. We apologize for the delay and any inconvenience this has caused.

Matthew Logterman, J.D.

Sr. Product Manager, Thomson Reuters Developer Community

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

@Alex Putkov. Hi Alex,

I'm still looking for a working solution and I hopefully think that you have a part (if not all) of the solution.

So as I told, I would like to make a screenshot of a Reuters Quote App 2 days a day at specific time. Notice that the computer used is a Reuters only computer and that the session is automically locked after a couple of minutes.

Your code in the flexsheet works well (even if the session is locked), but I wonder how to create a macro whithout using Flexsheet object.

I normally use the Application.OnTime function to launch a routine at a specified time but it's not working under Reuters vba (or I do something wrong). And I don't know how to use your TKoClock.AlarmTimeReachedEventDataBag without the FlexSheet objet. Don't find any documentation on Kobra KoClock reference.

My idea is to write a macro that I run on Monday 9:00am which will launch the TakeScreenshot macro @9:15am

Then at the end of the TakeScreenshot macro, the Alarm is set to 14:00pm. So @14:00pm, TakeScreenshot is executed and the Alarm is set again to 09:00am tomorrow.

I also want to know if it's possible when the Quote App window is activated to call the Reuters function (right click) "Share > Copy snapshot to clipboard" or "Share > Save snaphot as" (and define within the macro the name and the saveas directory) ?

Kind regards for you answers and happy new year !

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

Hi @JOG
There's a lot of questions here. I'll try to answer them all the best I can.
1. You cannot create a macro without using a Flexsheet because the macro resides in a Flexsheet.
2. In your macro you don't necessarily need to take the screenshot of the Flexsheet window. You could instead pop up a Quote app as I mentioned in the accepted answer on this thread, and take a screenshot of that window. You'll need to figure out how the get that window's handle. And another tricky part is to account for the time it takes the application to retrieve the data and display the quote, so you don't take the screenshot before the data is displayed. One way of doing this might be to popup the Quote app upon opening of the Flexsheet and then using this popup to take all the screenshots rather than creating a new popup every time.
3. I'm afraid there's no way to call from VBA the Copy snapshot to clipboard command available from the right click menu. To take the screenshot you need to get the window handle and emulate keyboard strokes.
4. You can schedule your macro using Application.OnTime method, although I wouldn't recommend it. If VBA runtime error occurs at any point, the next run of the macro will not be scheduled and the process will break. This is the reason why in my example I used a Clock object embedded in the Flexsheet to schedule the macro. In my example the Clock object is in the top right corner. You can view its properties by switching to design (or link) mode (select Link Mode command from the hamburger menu in the Flesheet window), then select the Clock object and hit Alt+Enter. You will see that the object is named Clock Object 6 and the alarm time is set with daily frequency. The alarm time is what triggers ClockObject6_AlarmTimeReached procedure. If you need to run the macro twice a day you can insert two Clock objects in the Flexsheet. Set the alarm on one of them for 9:15am and on the other for 2pm. Don't forget to add AlarmTimeReached event handler for the second Clock object.

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