Skip to content

WriteXLS error:Error in get(x, envir = envir) : variable names are limited to 256 bytes

4 messages · Patrick McKann, David Winsemius, Marc Schwartz

#
On Dec 10, 2010, at 4:39 PM, Patrick McKann wrote:

            
I have gotten tripped up by the argument syntax in WriteXLS myself,  
many times. Please check the help page for argument names and use  
them, especially paying attention to the fact that the first argument  
needs to be a character _vector_ (and I suspect that passing it a list  
may not qualify) and I always use the name for the Excel file  
argument. I suspect that this may work:

WriteXLS('alldata','test.xls')
#
On Dec 10, 2010, at 5:02 PM, David Winsemius wrote:

            
OOOPs. I wrote that before I noted that you said you were using a  
list, and I forgot to go back and fix it, so that would NOT work.
David Winsemius, MD
West Hartford, CT
#
On Dec 10, 2010, at 4:14 PM, David Winsemius wrote:

            
Hi David and Patrick,

Apologies for the delay in my reply as I am away on vacation at the moment.

As David surmised initially, the name of the object(s) to be exported, needs to be passed as a character vector. The vector can either contain the names of one or more data frames, or can be the single name of a list of data frames. The latter option was added in a September update. See the help page for an example of use.

Thus:

  WriteXLS("alldata", "test.xls")

should work.

HTH,

Marc Schwartz