Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xlsx_sheet_names

List sheets in an xlsx (Excel) file


Description

xlsx_sheets() returns the names of the sheets in a workbook, as a character vector. They are in the same order as they appear in the spreadsheet when it is opened with a spreadsheet application like Excel or LibreOffice.

Usage

xlsx_sheet_names(path, check_filetype = TRUE)

Arguments

path

Path to the xlsx file.

check_filetype

Logical. Whether to check that the filetype is xlsx (or xlsm) by looking at the file itself, rather than using the filename extension.

Value

A character vector of the names of the worksheets in the file.

Examples

examples <- system.file("extdata/examples.xlsx", package = "tidyxl")
xlsx_sheet_names(examples)

tidyxl

Read Untidy Excel Files

v1.0.7
GPL-3
Authors
Duncan Garmonsway [aut, cre], Hadley Wickham [ctb] (Author of included readxl fragments), Jenny Bryan [ctb] (Author of included readxl fragments), RStudio [cph] (Copyright holder of included readxl fragments), Marcin Kalicinski [ctb, cph] (Author of included RapidXML code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.