Native Excel File Support
EViews offers direct Excel file read and write capability. If you have data in an existing Excel spreadsheet and you wish to use it in an EViews workfile, simply drag and drop the Excel file onto an EViews workfile to start the import (see IMPORT command and Importing Data in our User's Guide) or drop it onto an empty area in the EViews frame window to create a new workfile (see WFOPEN command).
By default, EViews will try to read in objects by column and will look for a single header row for the object names. In addition, EViews can transpose the data before import if your objects are defined in rows instead.
In the other direction, you can save EViews workfiles directly to an Excel file by going to
File –> Save As, then selecting the proper Excel type in the Save as type dropdown (see WFSAVE command and Exporting Data in our User's Guide).
Note: Reading the newer Excel .XLSX file format was added in EViews 7. Saving in .XLSX format was added in EViews 8.
Using the EViews Excel Add-In
EViews also offers an Excel Add-In that can be used within Excel to read and link to EViews data residing in EViews file formats. The Excel add-in is installed by default with each EViews installation and can be seen in Excel's ADD-INS ribbon tab.
As a side note, our Excel add-in actually performs its work by making use of Excel's built-in support for OLEDB data sources. We created a read-only EViews OLEDB provider for this purpose. If you're familiar with using OLEDB providers with Excel, you can bypass our add-in altogether and just use our OLEDB provider directly (see Microsoft's documentation on Connect OLE DB data to your workbook). For more technical details on using our OLEDB provider, please see our whitepaper (PDF).
Object Linking and Embedding (OLE) Support
EViews also supports Microsoft's Object Linking and Embedding (OLE) technology for various EViews elements such as data tables and graphs.
In the past, you could always copy an EViews graph to the clipboard and then paste it into Excel as a static picture. But if you wanted to update that image (maybe to change line colors or even the graph type), you would have to redo the entire copy and paste operation from the beginning.
Now with OLE support, you can paste the graph as an EViews object instead of a static image, which saves the actual EViews graph object (along with all relevant data) directly into your spreadsheet. This embedded object now exists separately from the workfile and represents a snapshot of the graph at that point in time, similar to a static image. But unlike a static image, you can double-click the image to open it in EViews and change its attributes, which will be reflected automatically in your spreadsheet.
You can also go one step further and paste the EViews graph as a linked OLE object instead. As a linked object, Excel will keep track of where the object originally came from and will allow you to quickly update the object from the source workfile upon request. This means any changes made to the object in the source workfile (perhaps by another EViews user) can be reflected in your spreadsheet easily and quickly.
Note: EViews OLE objects can be used in other Office applications that support it, including Microsoft Word and PowerPoint.
For more details on using EViews OLE, please see our recent OLE blog post.
For details on using OLE with Microsoft Office, see their documentation on Create, edit, and control OLE objects.
Using Excel Macros (VBA)
For the ultimate in control and flexibility, EViews also offers a COM automation interface that can be used by the Excel macro language (VBA) to talk directly to EViews. With it, you can write an Excel macro to send and retrieve data and perform almost any EViews task via EViews commands.
For instance, you can write an Excel macro that:
- launches a new instance of EViews
- sends Excel data from a cell range to series objects in a new EViews workfile
- run various EViews commands on the data
- retrieve EViews results back into an Excel cell range
For Excel VBA examples and more details on using our COM Automation interface, please see our whitepaper (PDF).
For a quick introduction to writing Excel VBA macros, see Microsoft's documentation on Getting Started with VBA.