Page 1 of 1

EViews COM Automation and VBScript

Posted: Mon Apr 11, 2011 4:27 am
by alice_eviews
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.

Re: EViews COM Automation and VBScript

Posted: Mon Apr 11, 2011 8:53 am
by EViews Steve
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

Re: EViews COM Automation and VBScript

Posted: Mon Apr 11, 2011 9:05 am
by EViews Steve
Another sanity check -- install the latest patch for EViews 7.