Com Data Automation Error: "EViews is not licensed to allow more than one instance to run as a windows service..."

For questions regarding programming in the EViews programming language.

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

dieuler
Posts: 12
Joined: Thu Sep 15, 2016 12:36 pm

Com Data Automation Error: "EViews is not licensed to allow more than one instance to run as a windows service..."

Postby dieuler » Fri Jan 13, 2017 4:51 am

Hi,

I've been getting this message error lately. I made a simple code in VBScript, where I run eviews programs to make some calculations. The code I use to run the eViews Programs are like this:

Code: Select all

Dim mgr As New EViews.Manager Dim app As EViews.Application Set app = mgr.GetApplication(0) app.Run "run(100) c:\files\errortest.prg"

As Suggested by @EViews Steve in the below topic:

http://forums.eviews.com/viewtopic.php?f=5&t=16309

I'd like to understand what exactly causes this error and how could I fix it, please. Thank you in advance!

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

Re: Com Data Automation Error: "EViews is not licensed to allow more than one instance to run as a windows service..."

Postby EViews Steve » Fri Jan 13, 2017 9:30 am

That error appears if EViews detects that the calling process is running under a Windows Service process.

I assume that your VBScript example is being run inside of Excel. When you get this error, how are you launching the script? Are you triggering it from within Excel somehow or are you doing something else to launch Excel?

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

Re: Com Data Automation Error: "EViews is not licensed to allow more than one instance to run as a windows service..."

Postby EViews Steve » Fri Jan 13, 2017 9:58 am

Actually, let me be a bit more clear.

Our normal EViews license DOES allow you to run EViews under a Windows service, but only a single instance is allowed to run that way. This allowance was mainly made because this type of scenario is typical if you're calling 64-bit EViews from a 32-bit process or vice-versa (which Windows handles via Distributed COM, a hosted process).

Now your particular error doesn't seem to caused by this kind of cross-bitness situation because your error message doesn't mention 'DCOM' -- instead it mentions 'windows service'. So in your case, EViews is detecting that the calling process is an actual Windows service and that there is already a different instance of EViews already running.

If you'd like help figuring out why EViews is detecting the calling process as a windows service, let me know.

If you need to keep running your script as a windows service, then you'll be limited to a single instance. You might change your GetApplication call to say GetApplication(1) (1 means new or existing) so that if EViews is already running somewhere, the script will use that instead of creating a new one each time.

If you're confused because you don't think there is another instance of EViews already running, COM Automation scripts are notorious for orphaning COM references which leads to hidden instances of the host program (EViews, in this case) still running in the background forever. To check for this, run the Windows Task Manager, click on the Processes tab, click on the "Show processes from all users", then check the list of processes for an EViews process. If you see one, simply right-click it and select "End Process". Once it's all clear, try your script again.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests