Opening an Excel file from Excel VBA (with wfopen)

For questions regarding programming in the EViews programming language.

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

altaus
Posts: 20
Joined: Fri Jan 30, 2015 6:46 am

Opening an Excel file from Excel VBA (with wfopen)

Postby altaus » Fri Jan 30, 2015 7:00 am

Hi,

I'm trying to open an excel file in eViews from a VBA code in the spread-sheet. In the eViews program I am using the following:

wfopen "\\xxx\shared\xxx\xxx\zzz & zzzz\Lead Indicator\Trial DE Lead Ind.xlsm" range=eViews-data

However, when I try to run it from VBA with what I think the syntax should be like, it gives me either Syntax error or Expected:end of statement, depending on whether I use Range = "EViews-Data" (without quotas) or with quotas like below.

app.Run "wfopen ""\\xxx\shared\xxx\xxx\zzz & zzzz\Lead Indicator\UK Lead Test and 2014 Parameters.xlsm"" Range = "EViews-Data""

Could you please help me to find the right syntax for it? I haven't been able to find the solution in the forum.

Thanks a lot,
Marta

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

Re: Opening an Excel file from Excel VBA (with wfopen)

Postby EViews Steve » Tue Feb 17, 2015 8:36 am

Altaus:

You need to double-up the quotes inside the string. This includes the quotes around the range argument:

Code: Select all

range=""EViews-Data""
Steve


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests