EViews COM Automation and VBScript

For questions regarding programming in the EViews programming language.

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

alice_eviews
Posts: 1
Joined: Mon Apr 11, 2011 2:46 am

EViews COM Automation and VBScript

Postby alice_eviews » Mon Apr 11, 2011 4:27 am

I am using EViews COM automation in order to invoke EViews from a VB script. I do the following:

set mgr = CreateObject("Eviews.Manager")
set app = mgr.GetApplication(1)

But I am getting the following error:

"Eviews.Manager.1: GetApplication could not create instance of Eviews Application Object"

I am on Windows XP and using EViews 7.0

What am I doing wrong here? Any pointers will be greatly appreciated.

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

Re: EViews COM Automation and VBScript

Postby EViews Steve » Mon Apr 11, 2011 8:53 am

Hi Alice:

There are several things to check.

First, a quick sanity check. Make sure you can run EViews itself (on the same machine) without any problems.
Second, once EViews is running, type the following command into the EViews command window: REGCOMPONENTS. In the next dialog, verify that "COM Automation" is registered. Click "Yes" to register or re-register everything again. Verify that it completes successfully.

Try your VB script again.

If it still doesn't work, perhaps you're running into a 64-bit problem. Is your machine running a 64-bit OS? If so, you'll have to make sure your VB Script is running under the 32-bit script engine. Our objects are 32-bit and must be run in a 32-bit environment. On a 64-bit machine, the 32-bit script engine is found specifically at: c:\Windows\SysWow64\cscript.exe. So run your script like this:

c:\Windows\SysWow64\cscript.exe myscript.vbs

Steve

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

Re: EViews COM Automation and VBScript

Postby EViews Steve » Mon Apr 11, 2011 9:05 am

Another sanity check -- install the latest patch for EViews 7.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests