EViews COM Automation Interrupt Process VBScript
Posted: Thu Sep 15, 2016 2:44 pm
Hi,
I am using EViews COM Automation to run some programs, but sometimes I experience some problems with floating license and I'd like to interrupt the Eviews Process, so other colleagues can use EViews. Here is the code I wrote in VBScript:
Dim mgr, oEViewsApp
Set mgr = CreateObject("EViews.Manager")
Set oEViewsApp = mgr.GetApplication(1)
oEviewsApp.Hide()
oEviewsApp.Run("run ""C:\run.prg""")
oEviewsApp.Run("exit")
Set oEviewsApp = Nothing
Set mgr = Nothing
When there's no exception, the program runs normally and exits with no problem, but when there's an exception, say EViews is already opened, I won't be able to finish the process. Is there a way so that I can interrupt the process when I get a problem directly without using oEviewsApp.Run("exit") or someone has another solution? Thank you in advance!
I am using EViews COM Automation to run some programs, but sometimes I experience some problems with floating license and I'd like to interrupt the Eviews Process, so other colleagues can use EViews. Here is the code I wrote in VBScript:
Dim mgr, oEViewsApp
Set mgr = CreateObject("EViews.Manager")
Set oEViewsApp = mgr.GetApplication(1)
oEviewsApp.Hide()
oEviewsApp.Run("run ""C:\run.prg""")
oEviewsApp.Run("exit")
Set oEviewsApp = Nothing
Set mgr = Nothing
When there's no exception, the program runs normally and exits with no problem, but when there's an exception, say EViews is already opened, I won't be able to finish the process. Is there a way so that I can interrupt the process when I get a problem directly without using oEviewsApp.Run("exit") or someone has another solution? Thank you in advance!