Page 1 of 1

Opening an Excel file from Excel VBA (with wfopen)

Posted: Fri Jan 30, 2015 7:00 am
by altaus
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

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

Posted: Tue Feb 17, 2015 8:36 am
by EViews Steve
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