Error message

For questions regarding programming in the EViews programming language.

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

aleksey73
Posts: 7
Joined: Fri Jun 03, 2011 8:19 am

Error message

Postby aleksey73 » Wed Jul 20, 2011 11:59 am

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

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

Re: Error message

Postby EViews Steve » Wed Jul 20, 2011 12:18 pm

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

aleksey73
Posts: 7
Joined: Fri Jun 03, 2011 8:19 am

Re: Error message

Postby aleksey73 » Thu Jul 21, 2011 6:34 am

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

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

Re: Error message

Postby EViews Gareth » Thu Jul 21, 2011 7:54 am

What error does it show when you run it in EViews?

aleksey73
Posts: 7
Joined: Fri Jun 03, 2011 8:19 am

Re: Error message

Postby aleksey73 » Thu Jul 21, 2011 8:01 am

Division by zero in "ARSCALEGVA equation" in "_MODEL.ADDINIT(V=N,S=B) @ALL".

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

Re: Error message

Postby EViews Gareth » Thu Jul 21, 2011 8:13 am

Would it be possible for you to email us the workfile too?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests