Skip to content

Commit

Permalink
silence unnecessary warning caused by bug in openxlsx (ycphs/openxlsx…
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbarks committed Sep 29, 2023
1 parent e7178e5 commit ebcea3c
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions R/qxl.R
Original file line number Diff line number Diff line change
Expand Up @@ -577,16 +577,18 @@ qxl_ <- function(x,
i_rng <- range(which(validate_df[[1]] %in% j)) + valid_start - 1L
excel_range <- paste0("'valid_options'!", "$B$", i_rng[1], ":", "$B$", i_rng[2])

openxlsx::dataValidation(
wb,
sheet,
cols = which(names(x) %in% j),
rows = data_start_row:nrow_x,
type = "list",
value = excel_range,
allowBlank = TRUE,
showInputMsg = TRUE,
showErrorMsg = TRUE
suppressWarnings(
openxlsx::dataValidation(
wb,
sheet,
cols = which(names(x) %in% j),
rows = data_start_row:nrow_x,
type = "list",
value = excel_range,
allowBlank = TRUE,
showInputMsg = TRUE,
showErrorMsg = TRUE
)
)
}
}
Expand Down Expand Up @@ -652,16 +654,18 @@ qxl_ <- function(x,

excel_range <- paste0("'valid_options_cond'!", "$B$", i_rng[1], ":", "$B$", i_rng[2])

openxlsx::dataValidation(
wb,
sheet,
col = which(names(x) %in% col_validation),
rows = data_start_row + i - 1,
type = "list",
value = excel_range,
allowBlank = TRUE,
showInputMsg = TRUE,
showErrorMsg = TRUE
suppressWarnings(
openxlsx::dataValidation(
wb,
sheet,
cols = which(names(x) %in% col_validation),
rows = data_start_row + i - 1,
type = "list",
value = excel_range,
allowBlank = TRUE,
showInputMsg = TRUE,
showErrorMsg = TRUE
)
)
}
}
Expand Down

0 comments on commit ebcea3c

Please sign in to comment.