Learn R Programming

openxlsx (version 4.1.0)

removeColWidths: Remove column widths from a worksheet

Description

Remove 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 columns to remove custom width (if any) from.

See Also

setColWidths

Examples

Run this code
# NOT RUN {
## Create a new workbook
wb <- loadWorkbook(file = system.file("loadExample.xlsx", package = "openxlsx"))

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

Run the code above in your browser using DataLab