Learn R Programming

openxlsx (version 1.0.3)

removeColWidths: Remove custom column widths from a worksheet

Description

Remove custom column widths from a worksheet

Usage

removeColWidths(wb, sheet, cols)

Arguments

wb
A workbook object
sheet
A name or index of a worksheet
cols
Indices of colunss to remove custom width (if any) from.

See Also

setColWidths

Examples

Run this code
## Create a new workbook
wb <- loadWorkbook(xlsxFile = file.path(path.package("openxlsx"), "loadExample.xlsx"))

## remove column widths in columns 1 to 10
removeColWidths(wb, 1, cols = 1:10)
saveWorkbook(wb, "removeColWidthsExample.xlsx", overwrite = TRUE)

Run the code above in your browser using DataLab