Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-27 Thread Gabor Grothendieck
You could use RDCOMClient or rcom packages to update an Excel spreadsheet in place and you would not need any VBA at all. Search through the archives for the keyword Excel.Application . On 3/27/07, Moshe Olshansky [EMAIL PROTECTED] wrote: OK. By the way, I only thought that I could do what I

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-26 Thread Moshe Olshansky
: 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 [EMAIL PROTECTED]: Hello! I have no problem reading Excel files (each worksheet in the file is a table which can be read - at least in my

[R] Updating a worksheet in Excel file using RODBC

2007-03-26 Thread Moshe Olshansky
Dear Prof. Ripley, You seem not to have tried the simplest possible option. The following works for me (beware of wrapped lines from mailers) chan - odbcDriverConnect(DRIVER=Microsoft Excel Driver (*.xls);DBQ=C:\\bdr\\hills.xls; ReadOnly=False) sqlSave(chan, USArrests, tests, fast=TRUE) # or

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-26 Thread Prof Brian Ripley
Yes, sqlDrop does not work correctly for Excel worksheet names (and there are other quirks). As I said in another message, it is on my TODO list to make this work better, but in the absence of good documentation of what the Excel ODBC driver should do and several with known bugs it is largely

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-26 Thread Moshe Olshansky
OK. By the way, I only thought that I could do what I wanted! It worked once but then it failed. When I was trying to update an existing sheet I got an error message saying that it existed and when I was trying to make a new sheet (something that worked once) I got a message saying that there

[R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Moshe Olshansky
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

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Prof Brian Ripley
The problem is that way the ODBC driver exposes table names is not valid SQL, and nor is the way quoting has to be used. You can get around this via direct SQL sent by sqlQuery. In addition, by default the Excel ODBC driver gives you read-only access to worksheets. Searching the list

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Prof Brian Ripley
On Fri, 23 Mar 2007, Prof Brian Ripley wrote: The problem is that way the ODBC driver exposes table names is not valid SQL, and nor is the way quoting has to be used. You can get around this via direct SQL sent by sqlQuery. In addition, by default the Excel ODBC driver gives you read-only

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Hans-Peter
Hi, 2007/3/23, Moshe Olshansky [EMAIL PROTECTED]: 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