Writing into existing Excel file: possible to remove header?

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

etienne
Posts: 19
Joined: Wed Jun 12, 2013 10:32 am

Writing into existing Excel file: possible to remove header?

Postby etienne » Wed Jun 12, 2013 10:52 am

Hi,

We would like to export only the values of series into an existing Excel worksheet while preserving the existing data. The new EViews 8 pagesave function with the 'mode=update' option comes close to doing so, although I can't find a way for the names of the series not to be included as a header to the values. Is there a way to achieve this? Something as the 'nonames' option of the write command?

Best regards,

Étienne

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Writing into existing Excel file: possible to remove hea

Postby EViews Glenn » Wed Jun 12, 2013 1:31 pm

Try something like

Code: Select all

pagesave(type=excelxml, mode=update) C:\Book1.xlsx nonames

etienne
Posts: 19
Joined: Wed Jun 12, 2013 10:32 am

Re: Writing into existing Excel file: possible to remove hea

Postby etienne » Thu Jun 13, 2013 7:09 am

Thanks Glenn, it works. As a test, to export only the values (no dates, no headers) of a series named x into an existing spreadsheet, beginning at cell C3 of Sheet2, I used the following command:

Code: Select all

pagesave(type=excelxml, mode=update, noid) C:\Book1.xlsx nonames range="Sheet2!C3" @keep x
To write the same values in a row, I used:

Code: Select all

pagesave(type=excelxml, mode=update, noid) C:\Book1.xlsx nonames range="Sheet2!C3" byrow @keep x
The order of the filename and the range specification is different than the one in the example given in the command reference, though it corresponds to the order the syntax section suggests (pagesave(type=excelxml, mode=update, noid) C:\Local\Book1.xlsx nonames range="Sheet2!C3" @keep x).

Please note that if I specify mode=create (and a non-existent file name), it does write starting at cell C3, but on the first sheet, Sheet1.

Best regards,

Étienne


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests