Eviews8-Using with .vbs for extraction.

For questions regarding programming in the EViews programming language.

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

san_sin
Posts: 3
Joined: Thu Jun 06, 2013 3:23 am

Eviews8-Using with .vbs for extraction.

Postby san_sin » Fri Jun 07, 2013 12:01 am

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!

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

Re: Eviews8-Using with .vbs for extraction.

Postby EViews Steve » Fri Jun 07, 2013 12:42 pm

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

san_sin
Posts: 3
Joined: Thu Jun 06, 2013 3:23 am

Re: Eviews8-Using with .vbs for extraction.

Postby san_sin » Thu Jun 13, 2013 5:26 am

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..

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

Re: Eviews8-Using with .vbs for extraction.

Postby EViews Steve » Thu Jun 13, 2013 7:33 am

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

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

Re: Eviews8-Using with .vbs for extraction.

Postby EViews Steve » Tue Jun 18, 2013 9:06 am

So did you get it working?

san_sin
Posts: 3
Joined: Thu Jun 06, 2013 3:23 am

Re: Eviews8-Using with .vbs for extraction.

Postby san_sin » Tue Jun 25, 2013 2:49 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Eviews8-Using with .vbs for extraction.

Postby EViews Gareth » Tue Jun 25, 2013 7:59 am

Steve is on vacation for a week. I'm sure he'll get back to you once he returns.

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

Re: Eviews8-Using with .vbs for extraction.

Postby EViews Steve » Mon Jul 01, 2013 7:55 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest