[R] Updating a worksheet in Excel file using RODBC

Moshe Olshansky
Mon, 26 Mar 2007 23:32:15 -0000

Dear Hans-Peter,

Thank you very much for your note!

I tried your package and it works all right (i.e. it indeed writes data to Excel
files), however it creates a new Excel file and this is not what I really need.
I need to update/create one sheet in the existing file.
I am using R do compute some data but then it must be put into an Excel file and
an Excel chart must be created.  So I intended to (manually) create one excel
file and to write a VBA macro which makes a desirable chart of a certain sheet
(let's say Sheet1).  Then I intended to autoomatically make many copies of
this file with appropriate file names, write the right data to Sheet1 of each
such file so that when it is opened a desired chart is automatically created.
So creting a totally new file does not help me.

Best regards,

Moshe.

-----Original Message-----
From: Hans-Peter [mailto:gchappi at gmail.com]
Sent: Saturday, 24 March 2007 3:44 AM
To: Moshe Olshansky
Cc: R Help
Subject: Re: [R] Updating a worksheet in Excel file using RODBC


Hi,

2007/3/23, Moshe Olshansky <molshansky at
chimaeracapital.com>:
> Hello!
>
>I have no problem reading Excel files (each worksheet in the file is
a >"table" which can be read - at least in my
case).
>What I would like to do is to read such a table, change it (just the
>contents, not the format) and write it back, and this I can not do.
I am >getting the following error messages (3 slightly different
attempts):

> [snip]

As another option (if you work with Windows) you can check my
"xlsReadWrite" package (-> CRAN).

It should work very well in your case (it's not suited if you want to
use SQL (join) statements, but for plain data reading/writing it is
nice).

For both versions (free/pro) updates are pending. They should be
released by end of next week (but no guarantees).

--

Regards,
Hans-Peter


Moshe Olshansky

Chimaera Capital Limited
Level 4 / 349 Collins Street
Melbourne, Victoria 3000
Phone: +613 8614 8400
Fax: +613 8614 8410
Email: molshansky at chimaeracapital.com

Disclaimer: This message is intended only for the personal and confidential use
of the designated recipient(s) named above. If you are not the intended