openxlsx 4.2.8.1
January 27, 2026 ยท View on GitHub
Note: openxlsx is no longer under active development. The package is maintained, and CRAN warnings will be fixed, but non-critical issues will not be addressed unless accompanied by a pull request. Packages that depend on openxlsx do not need to take any action, but for new developments, users are encouraged to use alternatives like readxl, writexl, or openxlsx2. The first two packages provide support for reading and writing .xlsx files. The latter package is a modern reinterpretation of openxlsx and provides similar functions to modify worksheets. However, it is not a drop-in replacement, so you may want to consult resources like the update vignette.
openxlsx 4.2.8.1
- Fix for upcoming
testthatrelease (@hadley, #530)
openxlsx 4.2.8
- Fix the docs for
setLastModifiedBy()andgetCreators()(@PBfordev, #505) - Fix an integer overflow in
setRowHeights() - Fix a coercion warning in
get_worksheet_entries()(@philaris, #512) - Fix a bug in
deleteDataColumn()(@DavZim, #515)
openxlsx 4.2.7.1
- It's now possible to insert a hyperlink image by passing a URL, relative or absolute file path, or mailto string to the new
addressparameter ofinsertImage().
openxlsx 4.2.7
- Fixed warning on
dataValidation(..., type = "list")(#342) - Added optional argument to
loadWorkbookto decide if empty/blank cells should be converted to NA_character_ (the default) or left blank as is saveWorkbook()now succeeds when called after the user has set column widths for a range of columns (e.g. 1:2), saved the workbook, then set column widths for a new range that is inclusive of the previous one (e.g. 1:5) (#493).
Improvements
- Improve detectDates (#288)
- Preserve window size and position, also
getWindowSize()andsetWindowSize()(466)
openxlsx 4.2.6
- Fix external links (#410)
- Do not add unnecessary sheetPr node (#409)
- Add support for
namedRegions having dots and other special characters (#338). - Add type blanks and not blanks to conditional formatting (#311)
openxlsx 4.2.5
Fixes
openxlsx_setOp()now works with named list (#215)loadWorkbook()importsinlineStr. Values remaininlineStrwhen writing the workbook withsaveWorkbook(). Similarread.xlsxandreadWorkbookimportinlineStr.read.xlsx()no longer changes random seed (#183)- fixed a regression that caused fonts to be read in incorrectly (#207)
- add option to save as read only recommended (#201)
- fixed writing hyperlink formulas (#200)
write.xlsx()now throws an error if it doesn't have write permissions (#190)write.xlsx()now again uses the default ofoverwrite = TRUEfor saving files (#249)as.character.formula()exported to warn about potential conflicts with other packages (#312, #315)
Improvements
options()are more consistently set in functions (see: #289)Workbook$show()no longer fails when called in a 0 sheet workbook(#240)read.xlsx()again accepts.xlsmfiles (#205, #209)makeHyperlinkString()does no longer require a sheet argument (#57, #58)- improvements in how
openxlsxcreates temporary directories (see #262) writeData()callsforce(x)to evaluate the object before options are set (#264)createComment()now correctly handlesintegersinwidthandheight(#275)setStyles()acceptshalign="justify"(#305)
openxlsx 4.2.4
Fixes
write.xlsx()now successfully passeswithFilter(#151)- code clean up PR #168
- removal of unused variables PR #168
New features
- adds
buildWorkbook()to generate aWorkbookobject from a (named) list or a data.frame (#192, #187)- this is now recommended rather than the
write.xlsx(x, file) ; wb <- read.xlsx(file)functionality before write.xlsx()is now a wrapper forwb <- buildWorkbook(x); saveWorkbook(x, file)- parameter checking from
write.xlsx()>>buildWorkbook()are now held off until passed towriteData(),writeDataTable(), etc row.namesis now deprecated forwriteData()andwriteDataTable(); please userowNamesinstead
- this is now recommended rather than the
read.xlsx()now checks for the file extension.xlsx; previously it would throw an error when the file was.xlsor.xlmfiles- memory allocation improvements
- global options added for
minWidthandmaxWidth write.xlsx()>>buildWorkbook()can now handlecolWidthspassed as either a single element or alist()- Added ability to change positioning of summary columns and rows.
- These can be set with the
summaryColandsummaryRowarguments inpageSetup().
- These can be set with the
activeSheetallows to set and get the active (displayed) sheet of a workbook.- Adds new global options for workbook formatting (#165; see
?op.openxlsx)
openxlsx 4.2.3
New Features
-
Most of functions in openxlsx now support non-ASCII arguments better. More specifically, we can use non-ASCII strings as names or contents for
createNamedRegion()(#103),writeComment(),writeData(),writeDataTable()andwriteFormula(). In addition, openxlsx now reads comments and region names that contain non-ASCII strings correctly on Windows. Thanks to @shrektan for the PR #118. -
setColWidths()now supports zero-lengthcols, which is convenient whencolsis dynamically provided #128. Thanks to @shrektan for the feature request and the PR.
Fixes for Check issues
-
Fix to pass the tests for link-time optimization type mismatches
-
Fix to pass the checks of native code (C/C++) based on static code analysis
Bug Fixes
-
Grouping columns after setting widths no longer throws an error (#100)
-
Fix inability to save workbook more than once (#106)
-
Fix
loadWorkbook()sometimes importing incorrect column attributes
openxlsx 4.2.2
New Features
-
Added features for
conditionalFormattingto support also 'contains not', 'begins with' and 'ends with' -
Added return value for
saveWorkbook()the default value forreturnValueisFALSE(#71) -
Added Tests for new parameter of
saveWorkbook()
Bug Fixes
- Solved CRAN check errors based on the change discussed in PR#17277
openxlsx 4.2.0
New Features
- Added
groupColumns(),groupRows(),ungroupColumns(), andungroupRows()to group/ugroup columns/rows (#32)
Bug Fixes
- Allow xml-sensitive characters in sheetnames (#78)
Internal
- Updated roxygen2 to 7.1.1
openxlsx 4.1.5.1
Bug Fixes
- fixed issue #68
openxlsx 4.1.5
New Features
-
Add functions to get and set the creator of the xlsx file
-
add function to set the name of the user who last modified the xlsx file
Bug Fixes
-
Fixed NEWS hyperlink
-
Fixed writing of mixed EST/EDT datetimes
-
Added description for
writeFormula()to use only English function names -
Fixed validateSheet for special characters
Internal
-
applied the tidyverse-style to the package
styler::style_pkg() -
include tests for
cloneWorksheet
openxlsx 4.1.4
New Features
-
Added
getCellRefs()as function. #7 -
Added parameter for customizing na.strings
Bug Fixes
-
Use
zip::zipr()instead ofzip::zip(). -
Keep correct visibility option for loadWorkbook. #12
-
Add space surrounding "wrapText" #17
-
Corrected Percentage, Accounting, Comma, Currency class on column level
Internal
- update to roxygen2 7.0.0
openxlsx 4.1.3
New Features
- Added a
NEWS.mdfile to track changes to the package. - Added
pkgdownto create site.
Bug Fixes
-
Return values for cpp changed to R_NilValue for r-devel tests
-
Added empty lines at the end of files
openxlsx 4.1.2
- Changed maintainer
openxlsx 4.1.1
New Features
-
sep.namesallows choose other separator than '.' for variable names with a blank inside -
Improve handling of non-region names in
getNamedRegionsand add related test
openxlsx 4.1.0
New Features
-
deleteNamedRegionsto delete named region and optionally the worksheet data -
set Workbook properties 'title', 'subject', 'category'
Bug Fixes
-
pageSetupfails when passing in sheet by name -
matching sheet names with special characters now works
-
skipEmptyColsbeing ignored byread.xlsx.Workbook -
zero column data.frames would throw an error.
-
read.xlsxon files created using apache poi failed to match sheet name to xml file. -
deleted table re-appearing after save & load.
-
newline characters in table names would corrupt file
-
datetime precision
openxlsx 4.0.17
New Features
-
getNamedRegionsreturns sheet name and cell references along with the named regions. -
borderStyleandborderColourcan be vector to specify different values for each side -
dataValidationtype "list" -
dataBar showValue, gradient and border can now be set through conditionalFormatting() -
options("openxlsx.zipflags") to pass additional flags to zip application e.g. compression level
-
getTables()andremoveTable()to show and remove Excel table objects -
set column to 'hidden' with
setColWidths()
Bug Fixes
-
skipEmptyRows&skipEmptyColswas being ignored byread.xlsx -
date detection basic_string error
-
multiple spaces in table column names were not being maintained thus corrupting the xlsx file.
-
openXL fail silently on relative paths
-
headerStylefailed when writing a list of length 1 usingwrite.xlsx -
detectDateforread.xlsxissues -
some Excel column types causing existing styling to be removed
-
na.stringsno longer ignored forread.xlsx.Workbook -
partial dollar matches on 'font' and 'fill' fixed
-
maintain hidden columns and their custom widths in
loadWorkbook() -
overwriting cells with borders sometimes removed the border styling
openxlsx 4.0.0
New Features
-
Reduced RAM usage and improved performance
-
maintain vbaProject, slicers, pivotTables on load
-
Read and load from URL
Bug Fixes
-
Fix date time conversion accuracy issues.
-
Allow multibyte characters in names and comments.
-
Remove
tolower()over style number formats to allow uppercase cell formatting -
Stacking styles fixed.
openxlsx 3.0.2
New Features
-
"between" type for conditional formatting values in some interval.
-
colWidthsparameter added towrite.xlsxfor auto column widths. -
freezePaneparameter handling added towrite.xlsx. -
visibleparameter toaddWorksheetto hide worksheets. -
sheetVisiblefunction to get and assign worksheet visibility state "hidden"/"visible" -
pageBreakfunction to add page breaks to worksheets.
Bug Fixes
keepNAparameter added towrite.xlsx. Passed towriteData/writeDataTable
openxlsx 3.0.1
New Features
-
improved performance of
read.xlsxandloadWorkbook -
writeFormulafunction added to write cell formulas. Also columns with class "formula" are written as cell formulas similar how column classes determine cell styling -
Functionality to write comments and maintain comments with
loadWorkbook -
check.namesargument addedread.xlsxto make syntactically valid variable names -
loadWorkbookmaintains cell indents -
namedRegionparameter added toread.xlsxto read a named region. -
getNamedregions to return names of named regions in a workbook -
getSheetNamesto get worksheet names within an xlsx file.
Bug Fixes
-
convertToDateTimenow handles NA values -
read.xlsxrows bug fixed where non-consecutive cells were skipped. -
convertToDate&convertToDateTimenow handle NA values. -
out of bounds worksheet fixed for libre office xlsx files.
-
loadWorkbooknow maintainschartSheets
openxlsx 2.4.0
New Features
-
stackable cell styling
-
getDateOriginfunction to return the date origin used internally by the xlsx file to pass toconvertToDate -
Auto-detection of date cells. Cells that "look" like dates will be converted to dates when reading from file.
-
read.xlsx.Workbookto read from workbook objects -
colIndex,rowIndexadded toread.xlsxto only read specified rows and columns -
Excel slicers now maintained by
loadWorkbook -
fill styles extended to support
gradientFill
Bug Fixes
-
Encoding fixed and multi-byte characters now supported.
-
read.xlsxnow maintains multiple consecutive spaces and newline characters. -
convertToDate&convertToDateTimenow handle NA values. -
multiple selected worksheet issue which preventing adding of new worksheets in Excel.
-
zoomparameter now limited to [10, 400] and documentation updated. -
write.xlsxcolnames parameter being assigned to rownames -
Handling of NaN and Inf values in
writeData
openxlsx 2.1.3
New Features
-
conditionalFormattingtype "databar" -
asTableparameter towrite.xlsxto writing usingwriteDataTable. -
extended
numFmtformatting to numeric rounding also added option("openxlsx.numFmt" = ...) for default number formatting of numeric columns -
additional
numFmt"comma" to format numerics with "," thousands separator -
tableNameparameter towriteDataTableto assign the table a name -
headerStyleparameter towriteDataTablefor additional column names styling -
textRotationparameter tocreateStyleto rotate cell text -
functions
addFilter&removeFilterto add filters to columns -
Headers & footers extended, can now be set with
addWorksheetandsetHeaderFooter.setHeader&setFooterdeprecated. -
"fitToWidth" and "fitToHeight" logicals in
pageSetup. -
"zoom" parameter in addWorksheet to set worksheet zoom level.
-
"withFilter"" parameter to writeDataTable and writeData to remove table filters
-
keepNaparameter towriteDataTableandwriteDatato write NA values as #N/A -
auto column widths can now be set with width = "auto"
VIGNETTE
- section on
write.xlsxin Introductory vignette
Bug Fixes
-
Fix reading in of apostrophes
-
Styling blank cells no longer corrupts workbooks
-
read.xlsxnow correctly readssharedStringswith inline styling -
sharedStringsnow exact matches true/false to determine logical values from workbooks. -
fomulas in column caused openxlsx to crash. This has been fixed.
openxlsx 2.0.15
New Features
-
writeDatanow style based on column class the same aswriteDataTable -
Vignette "Formatting" for examples focused on formatting
-
Customizable date formatting with
createStyleand also through option("openxlsx.dateFormat" = ...) -
Customizable POSIX formatting with
createStyleand also through option("openxlsx.datetimeFormat" = ...) -
Generalised
conditionalFormatfunction to complex expressions and color scales. -
writeDataborder type "all" to draw all borders and maintain column styling. -
Deprecated "sheets" and replaced with "names" function
-
column class "scientific" to automatically style as scientific numbers
-
writeDatanow handles additional object classes: coxph, cox.zph, summary.coxph1 from Survival package
Bug Fixes
-
Invalid XML characters in hyperlinks now replaced.
-
Encoding issues when writing data read in with
read.xlsx -
scientific notation resulting in corrupt workbooks fix
-
Multiple saves of Workbooks containing conditional formatting were corrupt.
-
Latin1 characters now write correctly.
-
logicals written as 0/1 instead of TRUE/FALSE
openxlsx 2.0.1
New Features
-
write.xlsxfunction to write data directly to file via thewriteDatafunction with basic cell styling. -
writeDataTablenow styles columns of class 'Date', 'POSIXct', 'POSIXt', 'currency', 'accounting', 'percentage' as Excel formats Date, Date, Date, Currency, Accounting, Percentage respectively. -
Data of class 'Date', 'POSIXct', 'POSIXt', 'currency', 'accounting' are converted to integers upon writing (as opposed to characters).
-
writeDataTableconverts columns of class 'hyperlink' to hyperlinks. -
logicals are converted to Excel booleans
-
hyperlinks in loaded workbooks are now maintained
-
borderStyleargument tocreateStyleto modify border line type. -
borderStyleargument towriteDatato modify border line type. -
"worksheetOrder" function to shuffle order of worksheets when writing to file
-
openXLfunction to open an excel file or Workbook object
Bug Fixes
-
conversion of numeric data to integer in
read.xlsxfixed. -
readWorkbook/read.xlsxshould work now. Empty values are now padded with NA. Many other bugs fixed. -
borders on single row and/or column data.frames now work.
-
readWorkbook/read.xlsxcheck for TRUE/FALSE values is now case-insensitive. -
sheet names containing invalid xml characters (&, <, >, ', ") now work when referencing by name and will not result in a corrupt workbook.
-
sheet names containing non-local characters can now be referenced by name.
-
Invalid factor level when missing values in
writeData -
saveWorkbooknow accepts relative paths. -
Non-local character encoding issues.
-
errors in vignette examples.
-
numbers with > 8 digits were rounded in
writeData