Page 1 of 1

Writing into existing Excel file: possible to remove header?

Posted: Wed Jun 12, 2013 10:52 am
by etienne
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

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

Posted: Wed Jun 12, 2013 1:31 pm
by EViews Glenn
Try something like

Code: Select all

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

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

Posted: Thu Jun 13, 2013 7:09 am
by etienne
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