Hi. I'm using Eview7 and I'm just beginning to work with COM automation in VBA.
I have this set of commands in my program:
%currpath = @runpath
cd %currpath
In VBA I tried
app.Run ("%currpath = @runpath")
app.Run ("cd %currpath")
the first works but "cd %currpath" gives the error "Path or file not found: URRPATH in "CD URRPATH"
Do I need to use some combination of app.run and app.get?
Thanks, Silvana
VBA Com automation
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: VBA Com automation
Sending EViews commands thru the Run method is just like typing in the commands into the EViews command window.
And when you're using the EViews command window, you can't use variables like you can in an EViews program. So that means you have to create a program to do what you want, then run the program. You can create a text file (with a .PRG file extension) with the commands you want to run, then run the text file as a program.
Steve
And when you're using the EViews command window, you can't use variables like you can in an EViews program. So that means you have to create a program to do what you want, then run the program. You can create a text file (with a .PRG file extension) with the commands you want to run, then run the text file as a program.
Code: Select all
app.Run("run c:\mytest.prg")-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: VBA Com automation
As an aside, I'll add that the @runpath command returns the path from where the currently running EViews program is being stored. Since, as Steve points out, COM uses individual commands, and not EViews programs, @runpath will do nothing when issued from COM, unless it is included in a .prg file, and then COM is used to run the .prg.
Re: VBA Com automation
Yes. Thanks for pointing out that current directory problem. @runpath wouldn't make sense. Great tip about running a .prg text file. Thanks again.
Who is online
Users browsing this forum: No registered users and 2 guests
