0

Is there any way in R to import list or number of worksheets of xlsb excel file? I know that there is similar function for xlsx (excel_sheets) but it doesn't work for xlsb.

Anita
  • 1
  • 1
    Hi Anita! Have you tried the following package yet? https://cran.r-project.org/web/packages/readxlsb/vignettes/read-xlsb-workbook.html – Johnny Mar 25 '21 at 09:37

1 Answers1

1

With the {readxlsb} package, you can make a "trick" with the debug parameter of its main function using any worksheet (label or index at sheet parameter) or named object (at range parameter) from the workbook.

library(readxlsb)

src_path <- "directory/file.xlsb"  # your filepath

df <- readxlsb::read_xlsb(
  src_path,
  sheet = 1,    # got 1st worksheet, e.g.
  debug = TRUE
)

sheets <- df$env$sheets


# number of worksheets
print(nrow(sheets))

# their names
print(sheets$Name)

pseudorandom
  • 142
  • 1
  • 1
  • 10