Thursday, January 14, 2016

Object Linking and Embedding (OLE)

EViews has many users whose workflow includes repeatedly copying and pasting graphs and tables from EViews into the same Microsoft Office documents every time data or results are updated. We also have users who would like to give their colleagues the ability to adjust the appearance of their graphs and/or tables but without having the source workfile. One possible solution for both sets of users is to use Object Linking and Embedding (OLE).

Object Linking 

Object linking allows you to place your EViews graph or table into a Microsoft document but maintain a link/connection to the series or object in your EViews workfile. When changes are made to the source EViews workfile, those changes can be reflected immediately in the objects within the Microsoft document.



For example, we will use a monthly workfile dated from January 2014 to July 2016, but only have data up to December 2015. In the workfile, we have a group containing 2 series that will be used to create a graph. You will select all the cells in the spreadsheet view of that group, copy the cell range to the clipboard, and then paste the range as a link into a Word document.


To paste the table as a link into the Word document, select Paste Special from the Paste button
drop - down on the menu bar. From the Paste Special dialog, select Paste link and choose EViews Object from the As: box. Press OK.



Repeating the same process but with the stacked bar of our graph, will yield the below Word document with 2 linked objects:


Now that we have Word document completed, let’s say a month has passed and we now have data for January 2016. The first 2 things we will do is first open our EViews workfile and open our Word document. Next we will open group in the spreadsheet view and add our new observations for January 2016. Once the observations have been added, the linked objects in Word will automatically be updated.


In a different example, we have pasted an EViews equation object in a Microsoft Excel spreadsheet as a link.


After examining the equation results, we noticed that the Tbill series was missing. We then added Tbill and re-estimated our equation. Because it was linked, the equation output in the Excel spreadsheet was automatically updated.


Object Embedding

Object embedding gives you the ability to add an EViews object into a Microsoft document that is independent of the EViews workfile. Using OLE technology, the data is stored in the pasted object and therefore the workfile is no longer needed. This is similar to pasting a static image into Word, but it has the additional benefit that you can still modify the appearance of the image/object.
For example, we have selected an EViews graph and we copied and pasted it as an EViews object into a Microsoft Word document. (Note: Unlike linking, Paste must be selected instead of Paste link in the Paste Special dialog).

After saving your Word document, suppose you gave a copy of your document to a colleague, and they decide to make some changes to the graph (such as changing the graph type, line color, or the legend). Since you embedded an EViews object, you colleague can double click the object in the Word document, an EViews session will start (if one isn’t already available) and they can immediately edit the graph within EViews which will then change the Object in Word.


If, for example, they want to add a title and change the default legend text from “Female” and “Male” to “Total Female” and “Total Male”:


We have demonstrated 3 simple examples but more detailed information about OLE can be found in Extending EViews : Object Linking and Embedding (OLE) of EViews User’s Guide.

1 comment: