Hello,
I am looking for an example to get me started running EViews programs from Excel VBA. I have seen the white paper and some of the posts related to calling and working with workfiles, but did not see anything with the .prg files.
Below is what I have for workfiles, could someone please help me adjust this to work with EViews program files? I am working with version 7.
Dim program_to_call As String
program_to_call = "C:\program_file"
'Open connection to EViews
Dim mgr As New EViews.Manager
Dim app As EViews.Application
Set app = mgr.GetApplication(ExistingOrNew)
app.Run "wfopen " & program_to_call
Any help would be greatly appreciated.
how to call an EViews program file from Excel VBA?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
please_work
- Posts: 8
- Joined: Wed Dec 15, 2010 9:07 am
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to call an EViews program file from Excel VBA?
Did you try changing "wfopen" to "run"?
-
please_work
- Posts: 8
- Joined: Wed Dec 15, 2010 9:07 am
Re: how to call an EViews program file from Excel VBA?
Thanks - I did and it did call EViews.
However, it gave me the following error message
Run-time error '-2147023170 (800706be)':
Automation error
The remote procedure call failed
Any suggestions?
Thanks
However, it gave me the following error message
Run-time error '-2147023170 (800706be)':
Automation error
The remote procedure call failed
Any suggestions?
Thanks
-
please_work
- Posts: 8
- Joined: Wed Dec 15, 2010 9:07 am
Re: how to call an EViews program file from Excel VBA?
I was able to get this to work without activating EViews Manager
Set objShell = CreateObject("Wscript.Shell")
objShell.Run ("C:\EViews_program.prg")
Is there a location with a complete list of the command strings for EViews applications? Application.Run in particular
If possible, I would like to close all of the EViews workfiles and the program I called when it is finished.
Many thanks
Set objShell = CreateObject("Wscript.Shell")
objShell.Run ("C:\EViews_program.prg")
Is there a location with a complete list of the command strings for EViews applications? Application.Run in particular
If possible, I would like to close all of the EViews workfiles and the program I called when it is finished.
Many thanks
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: how to call an EViews program file from Excel VBA?
Application.Run is just like typing into the command window in EViews itself. Anything you can type into the EViews command window, you can pass to Application.Run.
So if you refer to our EViews Command Reference, you get a list of all available commands...
By the way, about your Remote Procedure call failure, that can happen if EViews crashes or the instance isn't there anymore when you make the call. If you can reliably recreate this problem, send me a sample VB script that does this and I'll try to debug it for you.
Steve
So if you refer to our EViews Command Reference, you get a list of all available commands...
By the way, about your Remote Procedure call failure, that can happen if EViews crashes or the instance isn't there anymore when you make the call. If you can reliably recreate this problem, send me a sample VB script that does this and I'll try to debug it for you.
Steve
Who is online
Users browsing this forum: No registered users and 2 guests
