Skip to content

Commit

Permalink
Merge pull request #210 from dseynaev/patch_read_xlsx_regex
Browse files Browse the repository at this point in the history
fix: extend regex in read.xlsx to allow .xlsm files; solves #209
  • Loading branch information
ycphs authored Jun 29, 2021
2 parents 114cfa5 + ccc5ed3 commit 472c27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/readWorkbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ read.xlsx.default <- function(
sheetselected <- FALSE
}

if (!grepl("\\.xlsx$", xlsxFile)) {
stop("openxlsx can only read .xlsx files", call. = FALSE)
if (!grepl("\\.xlsx|\\.xlsm$", xlsxFile)) {
stop("openxlsx can only read .xlsx or .xlsm files", call. = FALSE)
}

assert_true_false1(colNames)
Expand Down

0 comments on commit 472c27d

Please sign in to comment.