Page 1 of 1

Eviews8-Using with .vbs for extraction.

Posted: Fri Jun 07, 2013 12:01 am
by san_sin
I am using Eviews8 on windows7 machine ,in order to invoke Eviews from a vbscript.
I am getting following error-

C:\Users\sanjay>"C:\Windows\SysWOW64\cscript.exe" D:\marketshare\practice\extract_orig.vbs D:\marketshare\practice
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

D:\marketshare\practice\extract_orig.vbs(44, 1) Microsoft VBScript runtime error
: Error in loading DLL: 'mgr.GetApplication'

In the script I am doing some thing like this-
set mgr = CreateObject("Eviews.Manager")
set app = mgr.GetApplication( 1 )

What am I doing wrong here? Any response will be highly appreciated.

Thanks!

Re: Eviews8-Using with .vbs for extraction.

Posted: Fri Jun 07, 2013 12:42 pm
by EViews Steve
Ok, a few things to check for.

1. Make sure you download the latest patch for EViews 8. You can do this by running EViews and going to EViews Help Menu->EViews Update. Re-start EViews to install the update.

2. Make sure your copy of EViews 8 is registered properly. Run the EViews command "REGCOMPONENTS" and then click "Yes (All)" to re-register everything. Wait for the success message to appear.

3. The Prog ID for the EViews 8 Manager object is: "EViews.Manager.8". If you just ask for "EViews.Manager" it will return to you a COM object for the version of EViews that was last registered (which might be an older version like EViews 7).

Code: Select all

Set mgr = CreateObject("EViews.Manager.8")
4. If you are running the 32-bit VBS script engine, make sure you have the EViews 8 32-bit version installed. While technically a 32-bit VBS script should be able to use a 64-bit EViews COM component, there might be licensing issues on your machine that's preventing this. If you have EViews 8 64-bit installed, don't run your VBS script using the 32-bit script engine. Use the default 64-bit one.

5. Finally, see if there is an error message returned by CreateObject. You can display an error message like this:

Code: Select all

On Error Resume Next Err.Clear Set mgr = CreateObject("EViews.Manager.8") If Err.Number <> 0 Then WScript.Echo "Error: " & Err.Description Err.Clear Else WScript.Echo "OK" End If On Error Goto 0
Report back if you get an error message...

Steve

Re: Eviews8-Using with .vbs for extraction.

Posted: Thu Jun 13, 2013 5:26 am
by san_sin
Thanks for the help Steve..

Still the issue is unresolved...I tried all the steps except 4.
*Installing the latest patch
*Run the EViews command "REGCOMPONENTS" and reinstalled.
*created object with "Set mgr = CreateObject("EViews.Manager.8")" in vbscript
*tried to see if the error message is returned by createobject, it returns OK

Below error

C:\Users\sanjay>"C:\Windows\SysWOW64\cscript.exe" D:\marketshare\practice\extrac
t_orig.vbs D:\marketshare\practice"
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

OK
D:\marketshare\practice\extract_orig.vbs(57, 1) Microsoft VBScript runtime error
: Error in loading DLL: 'mgr.GetApplication'

VBScript file-

set mgr = CreateObject("Eviews.Manager.8")
On Error Resume Next
Err.Clear
Set mgr = CreateObject("EViews.Manager.8")
If Err.Number <> 0 Then
WScript.Echo "Error: " & Err.Description
Err.Clear
Else
WScript.Echo "OK"
End If
On Error Goto 0
set app = mgr.GetApplication( 1 )

What I am doing wrong here?How to check about point 4.

Please throw some more light.

Thanks..

Re: Eviews8-Using with .vbs for extraction.

Posted: Thu Jun 13, 2013 7:33 am
by EViews Steve
Hmm, if you're still getting the error, then it's being thrown by the "GetApplication" call so you need to check for the error message after that line like this:

Code: Select all

On Error Resume Next Err.Clear Set mgr = CreateObject("EViews.Manager.8") If err.number <> 0 then WScript.Echo "Error: " & Err.Description Err.Clear Else WScript.Echo "OK" end if Set app = mgr.GetApplication(1) If err.number <> 0 then WScript.Echo "Error: " & Err.Description Err.Clear Else WScript.Echo "OK" end if
By the way, I just tested this script on my Windows 7 64-bit machine, running the 32-bit VBS script engine talking to my EViews 8 64-bit and it worked fine.

Steve

Re: Eviews8-Using with .vbs for extraction.

Posted: Tue Jun 18, 2013 9:06 am
by EViews Steve
So did you get it working?

Re: Eviews8-Using with .vbs for extraction.

Posted: Tue Jun 25, 2013 2:49 am
by san_sin
Hi Steve,

I have introduced the error related code in .vbs as mentioned-

VBScript file-
---
---
set mgr = CreateObject("Eviews.Manager.8")
If err.number <> 0 then
WScript.Echo "Error: " & Err.Description
Err.Clear
Else
WScript.Echo "OK"
end if
set app = mgr.GetApplication(1)
If err.number <> 0 then
WScript.Echo "Error: " & Err.Description
Err.Clear
Else
WScript.Echo "OK"
end if
---
---
Still i get the same issue as mentioned with output--

C:\Users\sanjay>"C:\Windows\SysWOW64\cscript.exe" D:\marketshare\practice\extrac
t_orig.vbs D:\marketshare\practice
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

OK
D:\marketshare\practice\extract_orig.vbs(50, 1) Microsoft VBScript runtime error
: Error in loading DLL: 'mgr.GetApplication'

I am also using windows7 64 bit,Eviews8 64 bit.

Looks like the problem is with GetApplication,any thought into it.

-Sanjay

Re: Eviews8-Using with .vbs for extraction.

Posted: Tue Jun 25, 2013 7:59 am
by EViews Gareth
Steve is on vacation for a week. I'm sure he'll get back to you once he returns.

Re: Eviews8-Using with .vbs for extraction.

Posted: Mon Jul 01, 2013 7:55 am
by EViews Steve
Hmm, I don't really know then.

Perhaps you should try running cscript.exe as an administrator?

I would also try just creating a VB.NET windows application that does the same thing to see if there is something weird going on with your cscript engine.

If you want to check which version of EViews you are running, start EViews and go to the Help->About screen. If you see "64-bit" anywhere on the About dialog, you are running EViews 8 64-bit. If you don't, you are running EViews 8 32-bit.

Steve