Exporting and Importing to/from Excel spreadsheet

For questions regarding programming in the EViews programming language.

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

facosta
Posts: 23
Joined: Wed Jul 07, 2010 9:16 am

Exporting and Importing to/from Excel spreadsheet

Postby facosta » Fri Feb 11, 2011 10:16 am

Hello, thank you for the help here.

I would like to ask two questions about EViews-Excel:

1) Is there a way to export the coefficients of a particular regression to some specific cells of an excel sheet?
For example if I regress: Y=B*X1+D*X2+e, is it possible to export to the Cells B2 and B3 of the sheet "Coefficients" of the excel file "Regression" the values of B and D, the coefficients of the regression?

2) When importing from excel I know a way of doing it given the name of the file, the name of the sheet and the date, as for example:
wfcreate(wf=Data_Levles, page=Variables) q 1996:1 2010:2
read(b15, s=Data) "C:\Work\Date.xls" 1

Can I import from the excel file without giving the end date? I would like to import all the data existing in the excel sheet and then to give it the frequency. I also know how to give the date structure to the workfile with a variable imported from excel, but I don´t know how to make eviews to import all the data from the sheet (ie without giving neither the number of rows nor columns to be imported)

Thank you very much for all the assistance.
Regards.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting and Importing to/from Excel spreadsheet

Postby EViews Gareth » Fri Feb 11, 2011 10:19 am

1. This is somewhat of an open ended question. With a good knowledge of VBA for Excel, yes you can do it using COM. Without that, you're out of luck.

2. You should use the IMPORT command rather than the READ command.

facosta
Posts: 23
Joined: Wed Jul 07, 2010 9:16 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby facosta » Fri Feb 11, 2011 10:31 am

Ok, thanks. In fact I know VB for excel, but I don´t know how to relate it to Eviews, is COM a tool for that?
Thanks.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting and Importing to/from Excel spreadsheet

Postby EViews Gareth » Fri Feb 11, 2011 10:40 am

Yes. You should read through the COM whitepaper here:
http://eviews.com/download/download.html#docs

maragloria
Posts: 105
Joined: Tue Jun 29, 2010 7:09 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby maragloria » Fri May 13, 2011 7:59 am

Hi There,

I also have a question similar to question 2.

I am using the import comand and I would like to know how to tell Eviews that the dates are in the excel column A.
The data in excel is daily, 5-days week. I tried using the command @freq d5 but this, if I am not mistaken, does not make Eviews recognize that the data in column A are dates.

Here is the command I am using:

import(mode="o", page={%pays}) {%xlsfile} range={%pays}!$A$1:$W$5581 colhead=6 namepos=last na="#N/A N/A" @freq d5 @smpl @all

Thanks for your help,

Mara

maragloria
Posts: 105
Joined: Tue Jun 29, 2010 7:09 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby maragloria » Fri May 13, 2011 8:25 am

Please ignore my previous question. The code is working properly. Thanks.

sdbailey
Posts: 3
Joined: Wed May 18, 2011 10:34 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby sdbailey » Wed May 18, 2011 10:44 am

I have a different exporting question-- I'm seasonally adjusting a number of data series in a program, and generating the seasonal factors and the adjusted data-- how do I export these into excel files within the program? Thanks for any assistance.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting and Importing to/from Excel spreadsheet

Postby EViews Gareth » Wed May 18, 2011 10:46 am

You can use the WFSAVE command to save to a new Excel file.

sdbailey
Posts: 3
Joined: Wed May 18, 2011 10:34 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby sdbailey » Wed May 18, 2011 10:59 am

Thanks, is that available in version 4.1? I couldn't find it in the index.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting and Importing to/from Excel spreadsheet

Postby EViews Gareth » Wed May 18, 2011 11:00 am

No.

You might be able to use the write command.

sdbailey
Posts: 3
Joined: Wed May 18, 2011 10:34 am

Re: Exporting and Importing to/from Excel spreadsheet

Postby sdbailey » Wed May 18, 2011 11:29 am

That works. Thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests