Call Matlab from Eviews (COM Automation)

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

salahaddin
Posts: 17
Joined: Thu Dec 11, 2014 7:11 am

Call Matlab from Eviews (COM Automation)

Postby salahaddin » Sun Feb 26, 2017 7:30 pm

Hi everyone,

I am trying to make a link between eviews and matlab 2016. I did Regcomponents issue. But I do not know how should I proceed in Matlab in order to create a reference to the Eviews 9 library. Please help.

thanks.
Sam

KrilleJ
Posts: 40
Joined: Fri Feb 20, 2015 6:15 am

Re: Call Matlab from Eviews (COM Automation)

Postby KrilleJ » Mon Feb 27, 2017 2:45 am

Hi.

Have you tried:

Code: Select all

handle=actxserver('Eviews.Manager'); application=handle.GetApplication;
If that works you can use:

Code: Select all

application.Run('cd C:\MyEViewsHacks\');
to execute commands in EViews from Matlab.

/K

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Call Matlab from Eviews (COM Automation)

Postby EViews Steve » Thu Mar 02, 2017 9:41 am

salahaddin:

Your question is confusing...

Your subject header says "call matlab from eviews", but your question makes it sound like you're trying to call eviews from matlab.

Which is it?

If you're trying to control matlab from eviews, you need to make sure matlab's COM objects are properly registered with Windows. In particular, the matlab object whose progid is: MATLAB.Application. EViews can show you which matlab objects it can find in the registry if you go the Options/General Options/External program interface. Look in the MATLAB dropdown. If you don't see anything in that list it means MATLAB COM isn't properly registered on your machine. You'll have to look up matlab help on properly registering matlab com components.

If you're trying to control eviews from matlab, I would try using Excel as the controlling program first as all of our examples in our COM Automation whitepaper use Excel. To make sure EViews COM is properly registered you would use the REGCOMPONENTS command to bring up the Component Registration dialog, then click "Yes (All)" to re-register everything. If you run into problems, make sure your calling program is the same "bitness" as the version of EViews you're trying to control. In other words, if you're using Excel 32-bit (or MATLAB 32-bit), make sure you have EViews 32-bit installed as well. This doesn't mean 64-bit EViews won't work, but if you ever had an older 32-bit EViews application that was uninstalled, this could cause Windows to think the 32-bit COM objects are missing...

Once you get EViews COM automation working with our Excel examples, you can try it with MATLAB and it should work the same.

Steve


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests