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, e.g. 1.0.2
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"))

Copy Link

Version

Install

install.packages('XLConnect')

Monthly Downloads

6,210

Version

1.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Studer

Last Published

February 18th, 2025

Functions in XLConnect (1.2.0)

cloneSheet-methods

Cloning/copying worksheets
clearSheet-methods

Clearing worksheets in a workbook
createName-methods

Creating names in a workbook
clearNamedRegion-methods

Clearing named regions in a workbook
createCellStyle-methods

Creating custom named and anonymous cell styles
clearRangeFromReference-methods

Clearing cell ranges in a workbook
createFreezePane-methods

Creating a freeze pane on a worksheet
clearRange-methods

Clearing cell ranges in a workbook
createSheet-methods

Creating worksheets in a workbook
$-methods

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

Querying the active worksheet name
getActiveSheetIndex-methods

Querying the active worksheet index
cref2idx

Converting Excel cell references to indices
createSplitPane-methods

Creating a split pane on a worksheet
idx2aref

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

Workbook data extraction & replacement operators
extractSheetName

Extracting the sheet name from a formula
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
getDefinedNames-methods

Retrieving defined names in a workbook
getLastRow-methods

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

Checking for existence of worksheets in a workbook
getOrCreateCellStyle-methods

Retrieving or creating named cell styles
existsName-methods

Checking existence of named ranges in a workbook
getCellFormula-methods

Retrieving formula definitions from cells
getBoundingBox-methods

Querying the coordinates of a worksheet bounding box
hideSheet-methods

Hiding worksheets in a workbook
getLastColumn-methods

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

Checking if worksheets are hidden in a workbook
existsCellStyle-methods

Retrieving named cell styles
idx2col

Converting column indices to Excel column names
getSheets-methods

Querying available worksheets in a workbook
getReferenceFormula-methods

Querying reference formulas of Excel names
getCellStyle-methods

Retrieving named cell styles
isSheetVisible-methods

Checking if worksheets are visible in a workbook
getTables-methods

Querying available Excel tables in a workbook
readNamedRegion

Reading named regions from a workbook
isSheetVeryHidden-methods

Checking if worksheets are very hidden in a workbook
jTryCatch

Standard Java exception handling for XLConnect
renameSheet-methods

Renaming worksheets from workbooks
getCellStyleForType-methods

Querying the cell style per data type for the DATATYPE style action
readTable

Reading Excel tables from a workbook
getReferenceCoordinatesForName-methods

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

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

Reading data from worksheets
readNamedRegionFromFile

Reading named regions from an Excel file (wrapper function)
setColumnWidth-methods

Setting the width of a column in a worksheet
idx2cref

Converting indices to Excel cell references
loadWorkbook

Loading Microsoft Excel workbooks
setDataFormat-methods

Specifying custom data formats for cell styles
onErrorCell-methods

Behavior when error cells are detected
setStyleAction-methods

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

Querying worksheet position
saveWorkbook-methods

Saving Microsoft Excel workbooks
setActiveSheet-methods

Setting the active worksheet in a workbook
print-methods

Print a workbook's filename
setStyleNamePrefix-methods

Setting the style name prefix for the "name prefix" style action
mirai

Mirai Solutions GmbH
summary-methods

Summarizing workbook objects
normalizeDataframe

Data frame Normalization for Unit Tests
swissfranc

Historical Exchange Rates: CHF vs EUR, USD and GBP
setBorder-methods

Specifying borders for cell styles
removePane-methods

Removing panes from worksheet
setCellFormula-methods

Setting cell formulas
setAutoFilter-methods

Setting auto-filters on worksheets
removeSheet-methods

Removing worksheets from workbooks
setFillForegroundColor-methods

Specifying the fill foreground color for cell styles
setMissingValue-methods

Setting missing value identifiers
setDataFormatForType-methods

Setting the data format for the DATA_FORMAT_ONLY style action
xlcFreeMemory

Freeing Java Virtual Machine memory
setRowHeight-methods

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

Merging cells
setFillBackgroundColor-methods

Specifying the fill background color for cell styles
setFillPattern-methods

Specifying the fill pattern for cell styles
setWrapText-methods

Specifying text wrapping behaviour
setForceFormulaRecalculation-methods

Forcing Excel to recalculate formula values when opening a workbook
with.workbook

Evaluate an R expression in a workbook environment
show-methods

Display a workbook object
xlcMemoryReport

Reporting free Java Virtual Machine memory
workbook-class

Class "workbook"
readWorksheetFromFile

Reading data from worksheets in an Excel file (wrapper function)
setHyperlink-methods

Setting hyperlinks
wrapList

Wrapping of arguments in a list
writeNamedRegionToFile

Writing named regions to an Excel file (wrapper function)
writeWorksheet-methods

Writing data to worksheets
removeName-methods

Removing names from workbooks
setCellStyle-methods

Setting cell styles
setCellStyleForType-methods

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

Writing named regions to a workbook
setSheetColor-methods

Setting colors on worksheet tabs
xlcRestore

Restoring objects from Excel files
writeWorksheetToFile

Writing data to worksheets in an Excel file (wrapper function)
xlcCall

Automatic argument vectorization, default Java exception and warnings handling for XLConnect
setSheetPos-methods

Setting worksheet position
unhideSheet-methods

Unhiding worksheets in a workbook
unmergeCells-methods

Unmerging cells
xlcDump

Dumping data sets to Excel files
xlcEdit

Editing data sets in an Excel file editor
XLC

XLConnect Constants
aref2idx

Converting Excel cell references to row and column based cell references
appendWorksheet-methods

Appending data to worksheets
XLConnect-package

Excel Connector for R
XLConnect-deprecated

Deprecated functions in package XLConnect
aref

Constructing Excel area references
XLConnectSettings

Performing general settings for XLConnect
cellstyle-class

Class "cellstyle"
col2idx

Converting Excel column names to indices
addImage-methods

Adding images to a worksheet
appendNamedRegion-methods

Appending data to a named region