Learn R Programming

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 & 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"). In order to get started have a look at the XLConnect and XLConnect for the Impatient package vignettes, the numerous demos available via demo(package = "XLConnect") or browse through the comprehensive reference manual.

Alternatively, you may install XLConnect directly from our github repository using the excellent devtools package:

require(devtools)

# Installs the master branch of XLConnect (= current development version)
install_github("miraisolutions/xlconnect")

# Installs XLConnect with the given version
install_github("miraisolutions/xlconnect", ref = "<version>")

Please log any enhancement requests or bug reports with a simple and self-contained reproducible example as an issue on our github repository. For other questions you may also use Stackoverflow.

Build for release on CRAN

devtools::build(args=c("--compact-vignettes=gs+qpdf"))

Run tests with testthat

You need to have run devtools::install() first.

library(testthat)
library(XLConnect)
test_dir("tests/testthat")

Local Coverage Report

For a local html report, you need to install.packages(c("DT", "htmltools"))

You can create a local coverage report, viewable in a web browser, by running

library(covr)
covr:report()

Copy Link

Version

Install

install.packages('XLConnect')

Monthly Downloads

4,955

Version

1.3.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Studer

Last Published

February 24th, 2026

Functions in XLConnect (1.3.0)

createCellStyle-methods

Creating custom named and anonymous cell styles
cref2idx

Converting Excel cell references to indices
col2idx

Converting Excel column names to indices
clearSheet-methods

Clearing worksheets in a workbook
clearNamedRegion-methods

Clearing named regions in a workbook
clearRange-methods

Clearing cell ranges in a workbook
createName-methods

Creating names in a workbook
clearRangeFromReference-methods

Clearing cell ranges in a workbook
extractSheetName

Extracting the sheet name from a formula
existsSheet-methods

Checking for existence of worksheets in a workbook
existsName-methods

Checking existence of named ranges in a workbook
existsCellStyle-methods

Retrieving named cell styles
createSplitPane-methods

Creating a split pane on a worksheet
createSheet-methods

Creating worksheets in a workbook
getLastRow-methods

Querying the last (non-empty) row on a worksheet
getActiveSheetName-methods

Querying the active worksheet name
getBoundingBox-methods

Querying the coordinates of a worksheet bounding box
extraction-methods

Workbook data extraction & replacement operators
$-methods

Executing workbook methods in object$method(...) form
getActiveSheetIndex-methods

Querying the active worksheet index
getSheets-methods

Querying available worksheets in a workbook
getSheetPos-methods

Querying worksheet position
getReferenceCoordinatesForTable-methods

Querying the coordinates of the range of an Excel table
getReferenceFormula-methods

Querying reference formulas of Excel names
getLastColumn-methods

Querying the last (non-empty) column on a worksheet
getForceFormulaRecalculation-methods

Querying the coordinates of the range reference by an Excel name
getReferenceCoordinates-methods

Querying the coordinates of the range reference by an Excel name
loadWorkbook

Loading Microsoft Excel workbooks
normalizeDataframe

Data frame Normalization for Unit Tests
getOrCreateCellStyle-methods

Retrieving or creating named cell styles
onErrorCell-methods

Behavior when error cells are detected
jTryCatch

Standard Java exception handling for XLConnect
idx2cref

Converting indices to Excel cell references
getCellStyleForType-methods

Querying the cell style per data type for the DATATYPE style action
hideSheet-methods

Hiding worksheets in a workbook
getTables-methods

Querying available Excel tables in a workbook
isSheetHidden-methods

Checking if worksheets are hidden in a workbook
getDefinedNames-methods

Retrieving defined names in a workbook
getCellStyle-methods

Retrieving named cell styles
getCellFormula-methods

Retrieving formula definitions from cells
getReferenceCoordinatesForName-methods

Querying the coordinates of the range reference by an Excel name
idx2col

Converting column indices to Excel column names
isSheetVeryHidden-methods

Checking if worksheets are very hidden in a workbook
idx2aref

Converting row and column based area references to Excel area references
mergeCells-methods

Merging cells
print-methods

Print a workbook's filename
readNamedRegionFromFile

Reading named regions from an Excel file (wrapper function)
mirai

Mirai Solutions GmbH
isSheetVisible-methods

Checking if worksheets are visible in a workbook
readNamedRegion

Reading named regions from a workbook
readWorksheet-methods

Reading data from worksheets
readWorksheetFromFile

Reading data from worksheets in an Excel file (wrapper function)
readTable

Reading Excel tables from a workbook
removeName-methods

Removing names from workbooks
removePane-methods

Removing panes from worksheet
setCellStyleForType-methods

Setting the cell style per data type for the DATATYPE style action
setColumnWidth-methods

Setting the width of a column in a worksheet
setAutoFilter-methods

Setting auto-filters on worksheets
renameSheet-methods

Renaming worksheets from workbooks
removeSheet-methods

Removing worksheets from workbooks
setBorder-methods

Specifying borders for cell styles
saveWorkbook-methods

Saving Microsoft Excel workbooks
setActiveSheet-methods

Setting the active worksheet in a workbook
setCellStyle-methods

Setting cell styles
setCellFormula-methods

Setting cell formulas
setRowHeight-methods

Setting the height of a row in a worksheet
setSheetColor-methods

Setting colors on worksheet tabs
setFillPattern-methods

Specifying the fill pattern for cell styles
setForceFormulaRecalculation-methods

Forcing Excel to recalculate formula values when opening a workbook
wrapList

Wrapping of arguments in a list
swissfranc

Historical Exchange Rates: CHF vs EUR, USD and GBP
workbook-class

Class "workbook"
setHyperlink-methods

Setting hyperlinks
setSheetPos-methods

Setting worksheet position
setStyleAction-methods

Controlling application of cell styles when writing data to Excel
setDataFormatForType-methods

Setting the data format for the DATA_FORMAT_ONLY style action
setMissingValue-methods

Setting missing value identifiers
setDataFormat-methods

Specifying custom data formats for cell styles
xlcEdit

Editing data sets in an Excel file editor
unmergeCells-methods

Unmerging cells
unhideSheet-methods

Unhiding worksheets in a workbook
with.workbook

Evaluate an R expression in a workbook environment
writeNamedRegion-methods

Writing named regions to a workbook
xlcFreeMemory

Freeing Java Virtual Machine memory
writeWorksheetToFile

Writing data to worksheets in an Excel file (wrapper function)
writeWorksheet-methods

Writing data to worksheets
xlcMemoryReport

Reporting free Java Virtual Machine memory
show-methods

Display a workbook object
summary-methods

Summarizing workbook objects
setStyleNamePrefix-methods

Setting the style name prefix for the "name prefix" style action
setWrapText-methods

Specifying text wrapping behaviour
writeNamedRegionToFile

Writing named regions to an Excel file (wrapper function)
xlcCall

Automatic argument vectorization, default Java exception and warnings handling for XLConnect
xlcDump

Dumping data sets to Excel files
setFillForegroundColor-methods

Specifying the fill foreground color for cell styles
setFillBackgroundColor-methods

Specifying the fill background color for cell styles
xlcRestore

Restoring objects from Excel files
appendNamedRegion-methods

Appending data to a named region
aref2idx

Converting Excel cell references to row and column based cell references
XLConnect-package

Excel Connector for R
XLConnectSettings

Performing general settings for XLConnect
createFreezePane-methods

Creating a freeze pane on a worksheet
XLConnect-deprecated

Deprecated functions in package XLConnect
XLC

XLConnect Constants
addImage-methods

Adding images to a worksheet
configurePOI

Configuring Apache POI
cellstyle-class

Class "cellstyle"
cloneSheet-methods

Cloning/copying worksheets
appendWorksheet-methods

Appending data to worksheets
aref

Constructing Excel area references