Call Eviews from Matlab

476 views Asked by At

I am trying to call Eviews (8, 32bit) from Matlab (2013a, 32bit), but without success so far. I used the following code in Matlab:

clear all; clc;

hm = actxserver('EViews.Manager.8')
hm = COM.Eviews_Manager
h = hm.GetApplication(0)
h = Interface.EViews_8.0_Type_Library.IApplication  
h.invoke

h.Show()
h.Run('wfcreate comEV u 4')
h.Run('genr x = @obsid')

I get the following error:

>> h = hm.GetApplication(0)
No appropriate method, property, or field GetApplication for class
COM.EViews_Manager_8.

Could anyone please help? Thanks in advance.

2

There are 2 answers

0
RAFisherman On

At the very least, you could write your program in EViews and then call it from Matlab* using the shell:

system(['"C:\Program Files\EViews 9\EViews9_x64.exe" "C:\Users\me\Documents\foo.prg"'])

*or Stata, R, Python, VBA, etc.

0
user6235189 On

The line of code

h = Interface.EViews_8.0_Type_Library.IApplication 

is not a command, is the output from the above line of your code (h = hm.GetApplication(0)).

Just remove it from your script. I think this is the problem.