Calling EViews from excel with spaces in the path name

For questions regarding programming in the EViews programming language.

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

djackson
Posts: 8
Joined: Fri Jun 19, 2015 1:33 am

Calling EViews from excel with spaces in the path name

Postby djackson » Thu Jul 11, 2019 4:46 am

I'm trying to run an eviews program from Excel, but if there are spaces in the path name then it truncates the path at the first space. How do I get around this? Code I'm using is below.

Code: Select all

Dim mgr As New EViews.Manager
Dim app As EViews.Application
Dim program_to_call As String

prog_path = "C:\EV_Auto_test\Space test\interpolate_q"

Set app = mgr.GetApplication(ExistingOrNew)
app.Run "run " & prog_path

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

Re: Calling EViews from excel with spaces in the path name

Postby EViews Steve » Thu Jul 11, 2019 7:08 am

Put quotes around the path inside your string.

Like this:

Code: Select all

app.Run "run """ & prog_path & """"


Steve

djackson
Posts: 8
Joined: Fri Jun 19, 2015 1:33 am

Re: Calling EViews from excel with spaces in the path name

Postby djackson » Fri Jul 12, 2019 8:56 am

Thanks very much, I knew it would be something simple I was missing.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 45 guests