Questions tagged [xlconnect]

XLConnect is a comprehensive and platform-independent R package for manipulating Microsoft Excel files from within R. XLConnect differs from other related R packages in that it is completely cross-platform and as such runs under Windows, Unix/Linux and Mac (32- and 64-bit). Moreover, it does not require any installation of Microsoft Excel or any other special drivers to be able to read & write Excel files.

XLConnect: Excel Connector for R

XLConnect is a comprehensive and cross-platform R package for manipulating Microsoft Excel files from within R. XLConnect differs from other related R packages in that it is completely cross-platform and as such runs under Windows, Unix/Linux and Mac (32- and 64-bit). Moreover, it does not require any installation of Microsoft Excel or any other special drivers to be able to read and write Excel files. The only requirement is a recent version of a Java Runtime Environment (JRE).

The package can easily be installed from CRAN via install.packages("XLConnect") (or install.packages("XLConnect", type="source") on Mac OS X).

Alternatively, the package can be installed directly from github using the devtools package:

require(devtools)
# Installs the master branch of XLConnect (current development version)
install_github("xlconnect", username = "miraisolutions", ref = "master")

Resources:

226 questions
2
votes
1 answer

Lock specific cells in an Excel file from R while preserving formatting

I'm trying to lock a block of cells in a series of Excel files, protect each file, and save them in their original location. I have the code working in every way except that locking the columns strips those cells of all formatting. I can't recreate…
2
votes
1 answer

Import cells without strikeout from xlsx

I'm trying to import an excel file avoiding cell that have a strikeout as style, but I'm not sure of how to do it. I know that in the library XLConnect there is a function getCellStyle but I cannot find much documentation on how to use it with a…
Barbara
  • 1,118
  • 2
  • 11
  • 34
2
votes
1 answer

R NoSuchMethodError (Java) when writing to MS Excel work sheet with XLConnect

I have a pre-formatted Microsoft Excel workbook which I am using as a template. I then want to paste my data.table into the workbook from R, leaving the column titles and formatting intact. This should be feasible with the package XLConnect: # Load…
Amy M
  • 967
  • 1
  • 9
  • 19
2
votes
1 answer

XLConnect: Attaching to 64 bit R

I have a need to export some R data to formatted excel files and have successfully used both the XLConnect and xlsx packages in R before. I recently moved to 64 bit R and can't get either to work. I worked through some Oracle/Java architecture…
justin a
  • 21
  • 3
2
votes
0 answers

Does XLConnect work with R 3.3.1 and Java 8?

My system is Mac OS 10.11.5 and has R 3.3.1 and java 1.8.0_92 installed. I have installed XLConnect and XLConnectJars. When I am trying load XLConnect, I get the following error message: library(XLConnect) Loading required package:…
scs
  • 567
  • 6
  • 22
2
votes
0 answers

R v3.3.0 on a 64-bit windows m/c with 18GB RAM - Memory issues while loading a dataframe to excel

I'm new to the world of R, so, please bear with me if the question is naive. Issue: I'm trying to load a bunch of data frames into different sheets of the same excel document. Each data frame has about 400-500K objects with around 60-70…
Sharad
  • 51
  • 4
2
votes
1 answer

Can I apply a cell style from a template workbook to cells in new workbooks using XLConnect?

I am writing some R code that reads in sheets from many Excel workbooks, identifies cells meeting certain criteria, and then saves these very same workbooks with the identified cells of interest in bold font. Because this is an efficiency tool, I do…
Andrew
  • 89
  • 5
2
votes
0 answers

RStudio - XLConnect - load xlsx workbook

when running the following code: library(forecast) Sys.setenv(JAVA_HOME='C:\\Program Files (x86)\\Java\\jre7') # for 32-bit library(XLConnect) wb <- loadWorkbook(filename = 'C:/Program Files/R/R-3.2.3/library/XLConnect/demoFiles/mtcars.xlsx') I…
syltheryn
  • 21
  • 2
2
votes
1 answer

Error: package ‘XLConnectJars’ could not be loaded in mac os

I got a problem when I called 'XLConnect' library in R. Loading required package: XLConnectJars JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib…
Luis Kang
  • 251
  • 1
  • 4
  • 15
2
votes
1 answer

Iteratively resave a directory tree of Excel files

I am regularly receiving data from a source that is producing a non-standard Excel format which can't be read by readxl::read_excel. Here is the github issue thread. Consequently I have a whole directory tree containing hundreds of (almost) Excel…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
2
votes
0 answers

Downloading an excel document into R from secure webpage

I'm trying to bring in an excel file into R that is located on a secure company SharePoint site. So far, I have tried using RCurl to do this, and this is the code I have currently: library(RCurl) curl = getCurlHandle() curlSetOpt(cookiejar =…
Myers333
  • 21
  • 3
2
votes
0 answers

R, XLConnect: Setting color with RGB code

I have come across the following problem. A lot of data is written to an Excel file. Within the written excel table, I want to set the cell color to a non-predefined value (which is a function of the number written to the cell). E.g.: The higher the…
Bernd
  • 3,405
  • 3
  • 18
  • 21
2
votes
1 answer

Invalid 'path' argument with XLConnect

I am trying and failing to get the following process to complete in R Version 3.1.2: library(RCurl) library(XLConnect) yr <- substr(Sys.Date(), 1, 4) mo <- as.character(as.numeric(substr(Sys.Date(), 6, 7)) - 1) temp <- tempfile() temp <-…
ulfelder
  • 5,305
  • 1
  • 22
  • 40
2
votes
1 answer

XLConnect output to Excel slow in MacBookPro. Why?

Windows executes this code instantly but on my Mac it takes a long time, some times more than 10 minutes, just to write two data tables of around 2000 rows each. Can some one suggest a solution please? I have used XLConnect R library. Thanks. # 8.…
mlg
  • 75
  • 5
2
votes
2 answers

How can I use R and XLConnect to save XLSX spreadsheets WITHOUT wrapping text in cells?

The XLConnect library in R allows reading and writing to Microsoft Excel XLSX spreadsheet files. However, when using writeWorksheet() or writeWorksheetToFile(), it automatically wraps the text in all cells. How do I turn off the text…
enricoferrero
  • 2,249
  • 1
  • 23
  • 28