Page 1 of 1

Error message

Posted: Wed Jul 20, 2011 11:59 am
by aleksey73
Hi,
I'm executing EViews from VBA and I would like to know if there's a command to see the error message that comes from EViews when it's executing something wrong.

I want to initialize add factors. If I run the command _model.addinit(v=n,s=b) @all in a program, it shows a error in the log, but if I execute this command, EViewsApp.Run "_model.addinit(v=n,s=b) @all", in my VBA's sub, I'm unable to know that an error happened and I would like to catch it when it's the case.

Thank you!
ALexis

Re: Error message

Posted: Wed Jul 20, 2011 12:18 pm
by EViews Steve
Alexis:

Are you catching any VBA errors that are thrown? I believe our Run command throws any EViews errors as an exception that should be caught by your code like this:

Code: Select all

Public Sub test() Dim mgr As New EViews.Manager Dim app As EViews.Application Set app = mgr.GetApplication(ExistingOrNew) On Error GoTo ErrorHandler app.Run "_model.addinit(v=n,s=b) @all" ExitHandler: Exit Sub ErrorHandler: MsgBox Err.Description Resume ExitHandler End Sub
Steve

Re: Error message

Posted: Thu Jul 21, 2011 6:34 am
by aleksey73
Hi Steve,

Yes, you're right, but it seems to be the only way that we don't catch the error, that's weird... If a run a model, it shows me when I have an error, but for the initialization of the add factors, we don't catch it unhopefully... So there's no other way to catch the errors that Eviews throws?...

Thank you!
Alexis

Re: Error message

Posted: Thu Jul 21, 2011 7:54 am
by EViews Gareth
What error does it show when you run it in EViews?

Re: Error message

Posted: Thu Jul 21, 2011 8:01 am
by aleksey73
Division by zero in "ARSCALEGVA equation" in "_MODEL.ADDINIT(V=N,S=B) @ALL".

Re: Error message

Posted: Thu Jul 21, 2011 8:13 am
by EViews Gareth
Would it be possible for you to email us the workfile too?