Page 1 of 3
Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Sat Oct 05, 2013 4:46 am
by eclee
Hi, All:
I wrote the following script [part] to call EViews (64 bit) from Matlab 2013a (64 bit) four months ago.
It was workable before, but it is failed now. I don't change anything. May anyone help me to solve this problem? Thanks!
Code: Select all
clear all; clc;
hm = actxserver('Eviews.Manager')
hm = COM.Eviews_Manager
h = hm.GetApplication(0)
% h = Interface.EViews_1.0_Type_Library.IApplication % EViews 7
% h = Interface.EViews_8.0_Type_Library.IApplication % EViews 8
h.invoke
h.Show()
h.Run('wfcreate comEV u 4')
h.Run('genr x = @obsid')
[Error Messenge]
h = hm.GetApplication(0)
No appropriate method, property, or field GetApplication for class
COM.Eviews_Manager.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Mon Oct 07, 2013 7:37 am
by EViews Steve
Seems like you lost your registration for the eviewsmgr.dll. You can re-register it by running EViews 8 64-bit and typing in REGCOMPONENTS into the EViews command window. Click Yes (All) to re-register everything.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Tue Oct 08, 2013 2:23 am
by eclee
Dear Steve:
Thanks for your quick response. I re-registered all components (as image), but it still cannot work. However, I follow "EViews COM Automation Technical Docu" (
http://www.eviews.com/download/whitepap ... mation.pdf), I find that it is workable to call EViews from EXCEL VBA. That means the problems come from MATLAB? Or the COM ports of other software are conflict to EViews'?
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Tue Oct 08, 2013 7:26 am
by EViews Steve
If you can call EViews from VBA, then it's not a problem with EViews.
I took a closer look at your script and I should mention that your script will only work if you are using EViews 8. To make sure of this, you should change the first line to be:
hm = actxserver('EViews.Manager.8')
to make sure you're getting the EViews 8 Manager class. Then you can cast the Application class to either 1.0 or 8.0 depending on which interface you want.
Also, if you are calling EViews from Matlab 32-bit by mistake, you'll get a licensing error unless you have the latest patch for EViews 8 installed. The patch that was released back in April changed the licensing to allow a single instance of DCOM (Distributed COM) to work -- which is what you need to allow 32-bit apps to call 64-bit COM objects, and vice-versa.
Good luck...
Steve
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Wed Oct 09, 2013 10:24 pm
by eclee
Dear Steve:
Thanks for your kind response again. I find out one reason why the script (program) doesn't work. It is failed after I uninstalled EViews 7.2. Matlab seem can only call EViews 7.2. Any suggestions about this situation?
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Thu Oct 10, 2013 8:22 am
by EViews Steve
Ok, I'm just guessing here...
Maybe MATLAB is trying to use the older EViews Manager interface that was originally defined by EViews 7 but was changed in EViews 8.
I don't know if this is possible, but I would try to clear out any cache or temporary information that MATLAB might be using from when you used it with EViews 7. Excel VBA has this issue as well, but simply restarting Excel clears it of any interface caches it was using before. Maybe MATLAB is more aggressive about re-using interfaces it found.
And again, I would change your actxserver line to be doing this:
Code: Select all
hm = actxserver('EViews.Manager.8')since this ProgID is different from the one you used with EViews 7.
Steve
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Thu Oct 10, 2013 8:39 am
by eclee
Dear Steve:
It still doesn't work.
%% [Matlab Code]
clear all; clc;
hm = actxserver('EViews.Manager.8') % EViews 8
% hm = actxserver('Eviews.Manager') % EViews 7
hm = COM.Eviews_Manager
h = hm.GetApplication(0)
% h = Interface.EViews_8.0_Type_Library.IApplication % EViews 8
% h = Interface.EViews_1.0_Type_Library.IApplication % EViews 7
h.invoke
h.Show()
%% [Matlab Output]
hm =
COM.EViews_Manager_8
hm =
COM.Eviews_Manager
No appropriate method, property, or field GetApplication for class COM.Eviews_Manager.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Thu Oct 10, 2013 8:45 am
by EViews Steve
I don't think it's a problem with EViews 8 COM registration if you can use it from VBA. However, to be absolutely sure, I would suggest you open a DOS command window (with Admin rights), go to the EViews 8 subdirectory (for 64-bit) and type in:
followed by:
For good measure, go to the "x86" subdirectory under EViews 8 and type in:
Code: Select all
regsvr32 EViewsMgr.dll
regsvr32 ev_dbase.dll
(this allows 32-bit programs to call and use 64-bit EViews).
After you are done with these registrations, you can also check your registry by running "regedit.exe" and checking the following values:
EViews Manager
[HKEY_CLASSES_ROOT\EViews.Manager\CLSID] should have the string value: {9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}
[HKEY_CLASSES_ROOT\EViews.Manager\CurVer] should have the string value: EViews.Manager.8
[HKEY_CLASSES_ROOT\CLSID\{9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}\InprocServer32] should contain the path to EViewsMgr.dll in your EViews 8 subdirectory
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}\InprocServer32] should contain the path to the x86 version of EViewsMgr.dll (this one only exists if your using Windows 64-bit)
EViews Application
[HKEY_CLASSES_ROOT\EViews.Application\CLSID] should have the string value: {D7FA78B1-622E-4EFC-A15D-951C141DE334}
[HKEY_CLASSES_ROOT\EViews.Application\CurVer] should have the string value: EViews.Application.8
[HKEY_CLASSES_ROOT\CLSID\{D7FA78B1-622E-4EFC-A15D-951C141DE334}\LocalServer32] should contain the path to EViews 8 64-bit exectuable
If you still have issues:
1. Do you have both 64-bit and 32-bit versions of MATLAB 2013a installed?
2. Can you use other 64-bit COM objects from within MATLAB 2013a 64-bit?
Steve
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Thu Oct 10, 2013 8:49 am
by EViews Steve
By the way, you're allowed to have both EViews 8 32-bit and 64-bit on the same machine using the same serial number. If you're still having issues with MATLAB, try installing EViews 8 32-bit to see if that resolves anything.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Fri Oct 11, 2013 1:05 am
by eclee
Dear Steve:
I follow your guide to check the registration status. They are all ready. But Matlab (Matlab 2013a [64bit] and Matlab 2013b [32bit / 64bit]) still can't call EViews 8 (32bit / 64bit). After I re-installed EViews 7, my script are workable again! (Both hm = actxserver('EViews.Manager.8') and hm = actxserver('Eviews.Manager') are OK). No ideas about this status....
EViews Manager
(OK) [HKEY_CLASSES_ROOT\EViews.Manager\CLSID] should have the string value: {9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}
(OK) [HKEY_CLASSES_ROOT\EViews.Manager\CurVer] should have the string value: EViews.Manager.8
(OK) [HKEY_CLASSES_ROOT\CLSID\{9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}\InprocServer32] should contain the path to EViewsMgr.dll in your EViews 8 subdirectory
(OK) [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{9F9BF4C6-AA5B-4278-99E1-0A1B4603C4AC}\InprocServer32] should contain the path to the x86 version of EViewsMgr.dll (this one only exists if your using Windows 64-bit)
EViews Application
(OK) [HKEY_CLASSES_ROOT\EViews.Application\CLSID] should have the string value: {D7FA78B1-622E-4EFC-A15D-951C141DE334}
(OK) [HKEY_CLASSES_ROOT\EViews.Application\CurVer] should have the string value: EViews.Application.8
(OK) [HKEY_CLASSES_ROOT\CLSID\{D7FA78B1-622E-4EFC-A15D-951C141DE334}\LocalServer32] should contain the path to EViews 8 64-bit exectuable
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Fri Oct 11, 2013 7:12 am
by EViews Steve
I believe this is a problem with MATLAB 64-bit.
When you get a chance, try running your script and look at your Task Manager at the same time. See if EViews8_x64.exe is running or if EViews7.exe is running.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Fri Oct 11, 2013 8:56 am
by EViews Steve
I don't have MATLAB 2013a, but I do have R2009b 64-bit so I installed that on my machine (which has both EViews 7 and EViews 8 64-bit installed).
I ran your script without issue.
So I uninstalled EViews 7, then ran this script:
Code: Select all
>> hm = actxserver('EViews.Manager')
hm =
COM.EViews_Manager
>> h = hm.GetApplication(0)
h =
Interface.EViews_8.0_Type_Library.IApplication
>> h.Show()
>> h.Hide()
>> h.delete
And it seemed to launch EViews 8 64-bit without a problem.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Sun Oct 13, 2013 9:54 pm
by eclee
Dear Steve:
Thanks for your kind try and help again~
When I run my script at the first time, I see EViews7.exe be started firstly, then EViews8_x64.exe follow up.
After that, EViews8_x64.exe be started only (EViews7.exe never shown again).
After I uninstall EViews 7 again, my script is not workable again. Matlab (newer versions even 32 bit or 64 bit) seem can only catch the registration key of EViews 7.
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Mon Oct 14, 2013 8:35 am
by EViews Steve
Very confused now.
EViews 8 does not need EViews 7 to be installed.
Your copy of MATLAB is using EViews 7 whenever you specify "EViews.Manager" as the ProgID? When you run REGCOMPONENTS inside of EViews 8, that should take over that ProgID to point to EViews 8 64-bit.
If your MATLAB is still using EViews 7 after you do a "REGCOMPONENTS" inside EViews 8, then I don't think you are using a 64-bit version of MATLAB.
I'm not sure what else to tell you...
Steve
Re: Call EViews 8 (64 bit) from Matalb 2013a (64 bit)
Posted: Mon Oct 14, 2013 8:42 am
by EViews Steve
When you ran REGCOMPONENTS before, did you click the "Yes (All)" button to actually perform the re-registration? Did you see the message that says "All components registered successfully." ?